System-wide checkpoint avoidance for distributed database systems

ABSTRACT

A database system may maintain a plurality of log records at a distributed storage system. Each of the plurality of log records may be associated with a respective change to a data page. Upon detection of a coalesce event for a particular data page, log records linked to the particular data page may be applied to generate the particular data page in its current state. Detecting the coalesce event may be a determination that the number of log records linked to the particular data page exceeds a threshold.

RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.14/201,517, filed Mar. 7, 2014, now U.S. Pat. No. 9,672,237, whichclaims benefit of priority to U.S. Provisional Application Ser. No.61/799,632, entitled “System-wide Checkpoint Avoidance for DistributedDatabase Systems,” filed Mar. 15, 2013, and which are incorporatedherein by reference in their entirety.

BACKGROUND

Distribution of various components of a software stack can in some casesprovide (or support) fault tolerance (e.g., through replication), higherdurability, and less expensive solutions (e.g., through the use of manysmaller, less-expensive components rather than fewer large, expensivecomponents). However, databases have historically been among thecomponents of the software stack that are least amenable todistribution. For example, it can difficult to distribute databaseswhile still ensuring the so-called ACID properties (e.g., Atomicity,Consistency, Isolation, and Durability) that they are expected toprovide.

While most existing relational databases are not distributed, someexisting databases are “scaled out” (as opposed to being “scaled up” bymerely employing a larger monolithic system) using one of two commonmodels: a “shared nothing” model, and a “shared disk” model. In general,in a “shared nothing” model, received queries are decomposed intodatabase shards (each of which includes a component of the query), theseshards are sent to different compute nodes for query processing, and theresults are collected and aggregated before they are returned. Ingeneral, in a “shared disk” model, every compute node in a cluster hasaccess to the same underlying data. In systems that employ this model,great care must be taken to manage cache coherency. In both of thesemodels, a large, monolithic database is replicated on multiple nodes(including all of the functionality of a stand-alone database instance),and “glue” logic is added to stitch them together. For example, in the“shared nothing” model, the glue logic may provide the functionality ofa dispatcher that subdivides queries, sends them to multiple computenotes, and then combines the results. In a “shared disk” model, the gluelogic may serve to fuse together the caches of multiple nodes (e.g., tomanage coherency at the caching layer). These “shared nothing” and“shared disk” database systems can be costly to deploy, and complex tomaintain, and may over-serve many database use cases.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating various components of a databasesoftware stack, according to one embodiment.

FIG. 2 is a block diagram illustrating a service system architecturethat may be configured to implement a web services-based databaseservice, according to some embodiments.

FIG. 3 is a block diagram illustrating various components of a databasesystem that includes a database engine and a separate distributeddatabase storage service, according to one embodiment.

FIG. 4 is a block diagram illustrating a distributed database-optimizedstorage system, according to one embodiment.

FIG. 5 is a block diagram illustrating the use of a separate distributeddatabase-optimized storage system in a database system, according to oneembodiment.

FIG. 6 is a block diagram illustrating how data and metadata may bestored on a given node of a distributed database-optimized storagesystem, according to one embodiment.

FIG. 7 is a block diagram illustrating an example configuration of adatabase volume, according to one embodiment.

FIG. 8 is a flow diagram illustrating a method for system-widecheckpoint avoidance in a distributed database system, according to someembodiments.

FIG. 9A is a series of illustrations demonstrating a method to performfast crash recovery for a distributed database system, according to someembodiments.

FIG. 9B is a flow diagram illustrating a method to perform fast crashrecovery for a distributed database system, according to someembodiments.

FIG. 9C is a flow diagram illustrating a method to process accessrequests in a recovered database, according to some embodiments.

FIG. 10 is a block diagram illustrating a computer system configured toimplement at least a portion of a database system that includes adatabase engine and a separate distributed database storage service,according to various embodiments.

While embodiments are described herein by way of example for severalembodiments and illustrative drawings, those skilled in the art willrecognize that the embodiments are not limited to the embodiments ordrawings described. It should be understood, that the drawings anddetailed description thereto are not intended to limit embodiments tothe particular form disclosed, but on the contrary, the intention is tocover all modifications, equivalents and alternatives falling within thespirit and scope as defined by the appended claims. The headings usedherein are for organizational purposes only and are not meant to be usedto limit the scope of the description or the claims. As used throughoutthis application, the word “may” is used in a permissive sense (i.e.,meaning having the potential to), rather than the mandatory sense (i.e.,meaning must). The words “include,” “including,” and “includes” indicateopen-ended relationships and therefore mean including, but not limitedto. Similarly, the words “have,” “having,” and “has” also indicateopen-ended relationships, and thus mean having, but not limited to. Theterms “first,” “second,” “third,” and so forth as used herein are usedas labels for nouns that they precede, and do not imply any type ofordering (e.g., spatial, temporal, logical, etc.) unless such anordering is otherwise explicitly indicated.

Various components may be described as “configured to” perform a task ortasks. In such contexts, “configured to” is a broad recitation generallymeaning “having structure that” performs the task or tasks duringoperation. As such, the component can be configured to perform the taskeven when the component is not currently performing that task (e.g., acomputer system may be configured to perform operations even when theoperations are not currently being performed). In some contexts,“configured to” may be a broad recitation of structure generally meaning“having circuitry that” performs the task or tasks during operation. Assuch, the component can be configured to perform the task even when thecomponent is not currently on. In general, the circuitry that forms thestructure corresponding to “configured to” may include hardwarecircuits.

Various components may be described as performing a task or tasks, forconvenience in the description. Such descriptions should be interpretedas including the phrase “configured to.” Reciting a component that isconfigured to perform one or more tasks is expressly intended not toinvoke 35 U.S.C. §112, paragraph six, interpretation for that component.

“Based On.” As used herein, this term is used to describe one or morefactors that affect a determination. This term does not forecloseadditional factors that may affect a determination. That is, adetermination may be solely based on those factors or based, at least inpart, on those factors. Consider the phrase “determine A based on B.”While B may be a factor that affects the determination of A, such aphrase does not foreclose the determination of A from also being basedon C. In other instances, A may be determined based solely on B.

The scope of the present disclosure includes any feature or combinationof features disclosed herein (either explicitly or implicitly), or anygeneralization thereof, whether or not it mitigates any or all of theproblems addressed herein. Accordingly, new claims may be formulatedduring prosecution of this application (or an application claimingpriority thereto) to any such combination of features. In particular,with reference to the appended claims, features from dependent claimsmay be combined with those of the independent claims and features fromrespective independent claims may be combined in any appropriate mannerand not merely in the specific combinations enumerated in the appendedclaims.

DETAILED DESCRIPTION

Various embodiments of system-wide checkpoint avoidance for adistributed database system are disclosed. A storage node of adistributed storage system may, in some embodiments, receive one or moreredo log records linked to a particular data page of stored on thestorage node from a database system. The data page may be one of aplurality of data pages storing data for a database. A coalesce eventmay be detected for the particular data page based, at least in part, onthe one or more redo log records linked to the particular data page. Acoalesce operation may be performed to apply the one or more log recordsto a previously stored version of the particular data to page togenerate the particular data page in its current state.

Various embodiments of fast crash recovery for a distributed databasesystem are disclosed. A database system head node may, in someembodiments, perform a failure recovery operation. Upon recovery from asystem failure, connections with storage nodes of a distributed storagesystem that store data for a database may be established. In someembodiments, upon establishment of the connections with the storagenodes, a database head node may make the database available for access.In at least some embodiments, one or more access requests may bereceived, and a current state of one or more data pages may requestedand received from the storage nodes.

The specification first describes an example web services-based databaseservice configured to implement the system-wide checkpoint avoidance(e.g., creating, deletion, use, manipulation, etc.) and fast crashrecovery techniques. Included in the description of the example webservices-based database service are various aspects of the example webservices-based database service, such as a database engine and aseparate distributed database storage service. The specification thendescribes flowcharts of various embodiments of methods for system-widecheckpoint avoidance and fast crash recovery. Next, the specificationdescribes an example system that may implement the disclosed techniques.Various examples are provided throughout the specification.

The systems described herein may, in some embodiments, implement a webservice that enables clients (e.g., subscribers) to operate a datastorage system in a cloud computing environment. In some embodiments,the data storage system may be an enterprise-class database system thatis highly scalable and extensible. In some embodiments, queries may bedirected to database storage that is distributed across multiplephysical resources, and the database system may be scaled up or down onan as needed basis. The database system may work effectively withdatabase schemas of various types and/or organizations, in differentembodiments. In some embodiments, clients/subscribers may submit queriesin a number of ways, e.g., interactively via an SQL interface to thedatabase system. In other embodiments, external applications andprograms may submit queries using Open Database Connectivity (ODBC)and/or Java Database Connectivity (JDBC) driver interfaces to thedatabase system.

More specifically, the systems described herein may, in someembodiments, implement a service-oriented database architecture in whichvarious functional components of a single database system areintrinsically distributed. For example, rather than lashing togethermultiple complete and monolithic database instances (each of which mayinclude extraneous functionality, such as an application server, searchfunctionality, or other functionality beyond that required to providethe core functions of a database), these systems may organize the basicoperations of a database (e.g., query processing, transactionmanagement, caching and storage) into tiers that may be individually andindependently scalable. For example, in some embodiments, each databaseinstance in the systems described herein may include a database tier(which may include a single database engine head node and a client-sidestorage system driver), and a separate, distributed storage system(which may include multiple storage nodes that collectively perform someof the operations traditionally performed in the database tier ofexisting systems).

As described in more detail herein, in some embodiments, some of thelowest level operations of a database, (e.g., backup, restore, snapshot,recovery, log record manipulation, and/or various space managementoperations) may be offloaded from the database engine to the storagelayer and distributed across multiple nodes and storage devices. Forexample, in some embodiments, rather than the database engine applyingchanges to a database (or data pages thereof) and then sending themodified data pages to the storage layer, the application of changes tothe stored database (and data pages thereof) may be the responsibilityof the storage layer itself. In such embodiments, redo log records,rather than modified data pages, may be sent to the storage layer, afterwhich redo processing (e.g., the application of the redo log records)may be performed somewhat lazily and in a distributed manner (e.g., by abackground process). In some embodiments, crash recovery (e.g., therebuilding of data pages from stored redo log records) may also beperformed by the storage layer and may also be performed by adistributed (and, in some cases, lazy) background process.

In some embodiments, because only redo logs (and not modified datapages) are sent to the storage layer, there may be much less networktraffic between the database tier and the storage layer than in existingdatabase systems. In some embodiments, each redo log may be on the orderof one-tenth the size of the corresponding data page for which itspecifies a change. Note that requests sent from the database tier andthe distributed storage system may be asynchronous and that multiplesuch requests may be in flight at a time.

In general, after being given a piece of data, a primary requirement ofa database is that it can eventually give that piece of data back. To dothis, the database may include several different components (or tiers),each of which performs a different function. For example, a traditionaldatabase may be thought of as having three tiers: a first tier forperforming query parsing, optimization and execution; a second tier forproviding transactionality, recovery, and durability; and a third tierthat provides storage, either on locally attached disks or onnetwork-attached storage. As noted above, previous attempts to scale atraditional database have typically involved replicating all three tiersof the database and distributing those replicated database instancesacross multiple machines.

In some embodiments, the systems described herein may partitionfunctionality of a database system differently than in a traditionaldatabase, and may distribute only a subset of the functional components(rather than a complete database instance) across multiple machines inorder to implement scaling. For example, in some embodiments, aclient-facing tier may be configured to receive a request specifyingwhat data is to be stored or retrieved, but not how to store or retrievethe data. This tier may perform request parsing and/or optimization(e.g., SQL parsing and optimization), while another tier may beresponsible for query execution. In some embodiments, a third tier maybe responsible for providing transactionality and consistency ofresults. For example, this tier may be configured to enforce some of theso-called ACID properties, in particular, the Atomicity of transactionsthat target the database, maintaining Consistency within the database,and ensuring Isolation between the transactions that target thedatabase. In some embodiments, a fourth tier may then be responsible forproviding Durability of the stored data in the presence of various sortsof faults. For example, this tier may be responsible for change logging,recovery from a database crash, managing access to the underlyingstorage volumes and/or space management in the underlying storagevolumes.

Turning now to the figures, FIG. 1 is a block diagram illustratingvarious components of a database software stack, according to oneembodiment. As illustrated in this example, a database instance mayinclude multiple functional components (or layers), each of whichprovides a portion of the functionality of the database instance. Inthis example, database instance 100 includes a query parsing and queryoptimization layer (shown as 110), a query execution layer (shown as120), a transactionality and consistency management layer (shown as130), and a durability and space management layer (shown as 140). Asnoted above, in some existing database systems, scaling a databaseinstance may involve duplicating the entire database instance one ormore times (including all of the layers illustrated in FIG. 1), and thenadding glue logic to stitch them together. In some embodiments, thesystems described herein may instead offload the functionality ofdurability and space management layer 140 from the database tier to aseparate storage layer, and may distribute that functionality acrossmultiple storage nodes in the storage layer.

In some embodiments, the database systems described herein may retainmuch of the structure of the upper half of the database instanceillustrated in FIG. 1, but may redistribute responsibility for at leastportions of the backup, restore, snapshot, recovery, and/or variousspace management operations to the storage tier. Redistributingfunctionality in this manner and tightly coupling log processing betweenthe database tier and the storage tier may improve performance, increaseavailability and reduce costs, when compared to previous approaches toproviding a scalable database. For example, network and input/outputbandwidth requirements may be reduced, since only redo log records(which are much smaller in size than the actual data pages) may beshipped across nodes or persisted within the latency path of writeoperations. In addition, the generation of data pages can be doneindependently in the background on each storage node (as foregroundprocessing allows), without blocking incoming write operations. In someembodiments, the use of log-structured, non-overwrite storage may allowbackup, restore, snapshots, point-in-time recovery, and volume growthoperations to be performed more efficiently, e.g., by using metadatamanipulation rather than movement or copying of a data page. In someembodiments, the storage layer may also assume the responsibility forthe replication of data stored on behalf of clients (and/or metadataassociated with that data, such as redo log records) across multiplestorage nodes. For example, data (and/or metadata) may be replicatedlocally (e.g., within a single “availability zone” in which a collectionof storage nodes executes on its own physically distinct, independentinfrastructure) and/or across availability zones in a single region orin different regions.

In various embodiments, the database systems described herein maysupport a standard or custom application programming interface (API) fora variety of database operations. For example, the API may supportoperations for creating a database, creating a table, altering a table,creating a user, dropping a user, inserting one or more rows in a table,copying values, selecting data from within a table (e.g., querying atable), canceling or aborting a query, creating a snapshot, and/or otheroperations.

In some embodiments, the database tier of a database instance mayinclude a database engine head node server that receives read and/orwrite requests from various client programs (e.g., applications) and/orsubscribers (users), then parses them and develops an execution plan tocarry out the associated database operation(s). For example, thedatabase engine head node may develop the series of steps necessary toobtain results for complex queries and joins. In some embodiments, thedatabase engine head node may manage communications between the databasetier of the database system and clients/subscribers, as well ascommunications between the database tier and a separate distributeddatabase-optimized storage system.

In some embodiments, the database engine head node may be responsiblefor receiving SQL requests from end clients through a JDBC or ODBCinterface and for performing SQL processing and transaction management(which may include locking) locally. However, rather than generatingdata pages locally, the database engine head node (or various componentsthereof) may generate redo log records and may ship them to theappropriate nodes of a separate distributed storage system. In someembodiments, a client-side driver for the distributed storage system maybe hosted on the database engine head node and may be responsible forrouting redo log records to the storage system node (or nodes) thatstore the segments (or data pages thereof) to which those redo logrecords are directed. For example, in some embodiments, each segment maybe mirrored (or otherwise made durable) on multiple storage system nodesthat form a protection group. In such embodiments, the client-sidedriver may keep track of the nodes on which each segment is stored andmay route redo logs to all of the nodes on which a segment is stored(e.g., asynchronously and in parallel, at substantially the same time),when a client request is received. As soon as the client-side driverreceives an acknowledgement back from a write quorum of the storagenodes in the protection group (which may indicate that the redo logrecord has been written to the storage node), it may send anacknowledgement of the requested change to the database tier (e.g., tothe database engine head node). For example, in embodiments in whichdata is made durable through the use of protection groups, the databaseengine head node may not be able to commit a transaction until andunless the client-side driver receives a reply from enough storage nodeinstances to constitute a write quorum. Similarly, for a read requestdirected to a particular segment, the client-side driver may route theread request to all of the nodes on which the segment is stored (e.g.,asynchronously and in parallel, at substantially the same time). As soonas the client-side driver receives the requested data from a read quorumof the storage nodes in the protection group, it may return therequested data to the database tier (e.g., to the database engine headnode).

In some embodiments, the database tier (or more specifically, thedatabase engine head node) may include a cache in which recentlyaccessed data pages are held temporarily. In such embodiments, if awrite request is received that targets a data page held in such a cache,in addition to shipping a corresponding redo log record to the storagelayer, the database engine may apply the change to the copy of the datapage held in its cache. However, unlike in other database systems, adata page held in this cache may not ever be flushed to the storagelayer, and it may be discarded at any time (e.g., at any time after theredo log record for a write request that was most recently applied tothe cached copy has been sent to the storage layer and acknowledged).The cache may implement any of various locking mechanisms to controlaccess to the cache by at most one writer (or multiple readers) at atime, in different embodiments. Note, however, that in embodiments thatinclude such a cache, the cache may not be distributed across multiplenodes, but may exist only on the database engine head node for a givendatabase instance. Therefore, there may be no cache coherency orconsistency issues to manage.

In some embodiments, the database tier may support the use ofsynchronous or asynchronous read replicas in the system, e.g., read-onlycopies of data on different nodes of the database tier to which readrequests can be routed. In such embodiments, if the database engine headnode for a given database receives a read request directed to aparticular data page, it may route the request to any one (or aparticular one) of these read-only copies. In some embodiments, theclient-side driver in the database engine head node may be configured tonotify these other nodes about updates and/or invalidations to cacheddata pages (e.g., in order to prompt them to invalidate their caches,after which they may request updated copies of updated data pages fromthe storage layer).

In some embodiments, the client-side driver running on the databaseengine head node may expose a private interface to the storage tier. Insome embodiments, it may also expose a traditional iSCSI interface toone or more other components (e.g., other database engines or virtualcomputing services components). In some embodiments, storage for adatabase instance in the storage tier may be modeled as a single volumethat can grow in size without limits, and that can have an unlimitednumber of IOPS associated with it. When a volume is created, it may becreated to with a specific size, with a specific availability/durabilitycharacteristic (e.g., specifying how it is replicated), and/or with anTOPS rate associated with it (e.g., both peak and sustained). Forexample, in some embodiments, a variety of different durability modelsmay be supported, and users/subscribers may be able to specify, fortheir database, a number of replication copies, zones, or regions and/orwhether replication is synchronous or asynchronous based upon theirdurability, performance and cost objectives.

In some embodiments, the client side driver may maintain metadata aboutthe volume and may directly send asynchronous requests to each of thestorage nodes necessary to fulfill read requests and write requestswithout requiring additional hops between storage nodes. For example, insome embodiments, in response to a request to make a change to adatabase, the client-side driver may be configured to determine the oneor more nodes that are implementing the storage for the targeted datapage, and to route the redo log record(s) specifying that change tothose storage nodes. The storage nodes may then be responsible forapplying the change specified in the redo log record to the targeteddata page at some point in the future. As writes are acknowledged backto the client-side driver, the client-side driver may advance the pointat which the volume is durable and may acknowledge commits back to thedatabase tier. As previously noted, in some embodiments, the client-sidedriver may not ever send data pages to the storage node servers. Thismay not only reduce network traffic, but may also remove the need forthe checkpoint or background writer threads that constrainforeground-processing throughput in previous database systems.

In some embodiments, many read requests may be served by the databaseengine head node cache. However, write requests may require durability,since large-scale failure events may be too common to allow onlyin-memory replication. Therefore, the systems described herein may beconfigured to minimize the cost of the redo log record write operationsthat are in the foreground latency path by implementing data storage inthe storage tier as two regions: a small append-only log-structuredregion into which redo log records are written when they are receivedfrom the database tier, and a larger region in which log records arecoalesced together to create new versions of data pages in thebackground. In some embodiments, an in-memory structure may bemaintained for each data page that points to the last redo log recordfor that page, backward chaining log records until an instantiated datablock is referenced. This approach may provide good performance formixed read-write workloads, including in applications in which reads arelargely cached.

In some embodiments, because accesses to the log-structured data storagefor the redo log records may consist of a series of sequentialinput/output operations (rather than random input/output operations),the changes being made may be tightly packed together. It should also benoted that, in contrast to existing systems in which each change to adata page results in two input/output operations to persistent datastorage (one for the redo log and one for the modified data pageitself), in some embodiments, the systems described herein may avoidthis “write amplification” by coalescing data pages at the storage nodesof the distributed storage system based on receipt of the redo logrecords.

As previously noted, in some embodiments, the storage tier of thedatabase system may be responsible for taking database snapshots.However, because the storage tier implements log-structured storage,taking a snapshot of a data page (e.g., a data block) may includerecording a timestamp associated with the redo log record that was mostrecently applied to the data page/block (or a timestamp associated withthe most recent operation to coalesce multiple redo log records tocreate a new version of the data page/block), and preventing garbagecollection of the previous version of the page/block and any subsequentlog entries up to the recorded point in time. In such embodiments,taking a database snapshot may not require reading, copying, or writingthe data block, as would be required when employing an off-volume backupstrategy. In some embodiments, the space requirements for snapshots maybe minimal, since only modified data would require additional space,although user/subscribers may be able to choose how much additionalspace they want to keep for on-volume snapshots in addition to theactive data set. In different embodiments, snapshots may be discrete(e.g., each snapshot may provide access to all of the data in a datapage as of a specific point in time) or continuous (e.g., each snapshotmay provide access to all versions of the data that existing in a datapage between two points in time). In some embodiments, reverting to aprior snapshot may include recording a log record to indicate that allredo log records and data pages since that snapshot are invalid andgarbage collectable, and discarding all database cache entries after thesnapshot point. In such embodiments, no roll-forward may be requiredsince the storage system will, on a block-by-block basis, apply redo logrecords to data blocks as requested and in the background across allnodes, just as it does in normal forward read/write processing.

Crash recovery may thereby be made parallel and distributed acrossnodes.

One embodiment of a service system architecture that may be configuredto implement a web services-based database service is illustrated inFIG. 2. In the illustrated embodiment, a number of clients (shown asdatabase clients 250 a-250 n) may be configured to interact with a webservices platform 200 via a network 260. Web services platform 200 maybe configured to interface with one or more instances of a databaseservice 210, a distributed database-optimized storage service 220 and/orone or more other virtual computing services 230. It is noted that whereone or more instances of a given component may exist, reference to thatcomponent herein may be made in either the singular or the plural.However, usage of either form is not intended to preclude the other.

In various embodiments, the components illustrated in FIG. 2 may beimplemented directly within computer hardware, as instructions directlyor indirectly executable by computer hardware (e.g., a microprocessor orcomputer system), or using a combination of these techniques. Forexample, the components of FIG. 2 may be implemented by a system thatincludes a number of computing nodes (or simply, nodes), each of whichmay be similar to the computer system embodiment illustrated in FIG. 10and described below. In various embodiments, the functionality of agiven service system component (e.g., a component of the databaseservice or a component of the storage service) may be implemented by aparticular node or may be distributed across several nodes. In someembodiments, a given node may implement the functionality of more thanone service system component (e.g., more than one database servicesystem component).

Generally speaking, clients 250 may encompass any type of clientconfigurable to submit web services requests to web services platform200 via network 260, including requests for database services (e.g., arequest to generate a snapshot, etc.). For example, a given client 250may include a suitable version of a web browser, or may include aplug-in module or other type of code module configured to execute as anextension to or within an execution environment provided by a webbrowser. Alternatively, a client 250 (e.g., a database service client)may encompass an application such as a database application (or userinterface thereof), a media application, an office application or anyother application that may make use of persistent storage resources tostore and/or access one or more databases. In some embodiments, such anapplication may include sufficient protocol support (e.g., for asuitable version of Hypertext Transfer Protocol (HTTP)) for generatingand processing web services requests without necessarily implementingfull browser support for all types of web-based data. That is, client250 may be an application configured to interact directly with webservices platform 200. In some embodiments, client 250 may be configuredto generate web services requests according to a Representational StateTransfer (REST)-style web services architecture, a document- ormessage-based web services architecture, or another suitable webservices architecture.

In some embodiments, a client 250 (e.g., a database service client) maybe configured to provide access to web services-based storage ofdatabases to other applications in a manner that is transparent to thoseapplications. For example, client 250 may be configured to integratewith an operating system or file system to provide storage in accordancewith a suitable variant of the storage models described herein. However,the operating system or file system may present a different storageinterface to applications, such as a conventional file system hierarchyof files, directories and/or folders. In such an embodiment,applications may not need to be modified to make use of the storagesystem service model of FIG. 1. Instead, the details of interfacing toWeb services platform 200 may be coordinated by client 250 and theoperating system or file system on behalf of applications executingwithin the operating system environment.

Clients 250 may convey web services requests (e.g., a snapshot request,parameters of a snapshot request, read request, restore a snapshot,etc.) to and receive responses from web services platform 200 vianetwork 260. In various embodiments, network 260 may encompass anysuitable combination of networking hardware and protocols necessary toestablish web-based communications between clients 250 and platform 200.For example, network 260 may generally encompass the varioustelecommunications networks and service providers that collectivelyimplement the Internet. Network 260 may also include private networkssuch as local area networks (LANs) or wide area networks (WANs) as wellas public or private wireless networks. For example, both a given client250 and web services platform 200 may be respectively provisioned withinenterprises having their own internal networks. In such an embodiment,network 260 may include the hardware (e.g., modems, routers, switches,load balancers, proxy servers, etc.) and software (e.g., protocolstacks, accounting software, firewall/security software, etc.) necessaryto establish a networking link between given client 250 and the Internetas well as between the Internet and web services platform 200. It isnoted that in some embodiments, clients 250 may communicate with webservices platform 200 using a private network rather than the publicInternet. For example, clients 250 may be provisioned within the sameenterprise as a database service system (e.g., a system that implementsdatabase service 210 and/or distributed database-optimized storageservice 220). In such a case, clients 250 may communicate with platform200 entirely through a private network 260 (e.g., a LAN or WAN that mayuse Internet-based communication protocols but which is not publiclyaccessible).

Generally speaking, web services platform 200 may be configured toimplement one or more service endpoints configured to receive andprocess web services requests, such as requests to access data pages (orrecords thereof). For example, web services platform 200 may includehardware and/or software configured to implement a particular endpoint,such that an HTTP-based web services request directed to that endpointis properly received and processed. In one embodiment, web servicesplatform 200 may be implemented as a server system configured to receiveweb services requests from clients 250 and to forward them to componentsof a system that implements database service 210, distributeddatabase-optimized storage service 220 and/or another virtual computingservice 230 for processing. In other embodiments, web services platform200 may be configured as a number of distinct systems (e.g., in acluster topology) implementing load balancing and other requestmanagement features configured to dynamically manage large-scale webservices request processing loads. In various embodiments, web servicesplatform 200 may be configured to support REST-style or document-based(e.g., SOAP-based) types of web services requests.

In addition to functioning as an addressable endpoint for clients' webservices requests, in some embodiments, web services platform 200 mayimplement various client management features. For example, platform 200may coordinate the metering and accounting of client usage of webservices, including storage resources, such as by tracking theidentities of requesting clients 250, the number and/or frequency ofclient requests, the size of data tables (or records thereof) stored orretrieved on behalf of clients 250, overall storage bandwidth used byclients 250, class of storage requested by clients 250, or any othermeasurable client usage parameter. Platform 200 may also implementfinancial accounting and billing systems, or may maintain a database ofusage data that may be queried and processed by external systems forreporting and billing of client usage activity. In certain embodiments,platform 200 may be configured to collect, monitor and/or aggregate avariety of storage service system operational metrics, such as metricsreflecting the rates and types of requests received from clients 250,bandwidth utilized by such requests, system processing latency for suchrequests, system component utilization (e.g., network bandwidth and/orstorage utilization within the storage service system), rates and typesof errors resulting from requests, characteristics of stored andrequested data pages or records thereof (e.g., size, data type, etc.),or any other suitable metrics. In some embodiments such metrics may beused by system administrators to tune and maintain system components,while in other embodiments such metrics (or relevant portions of suchmetrics) may be exposed to clients 250 to enable such clients to monitortheir usage of database service 210, distributed database-optimizedstorage service 220 and/or another virtual computing service 230 (or theunderlying systems that implement those services).

In some embodiments, platform 200 may also implement user authenticationand access control procedures. For example, for a given web servicesrequest to access a particular database, platform 200 may be configuredto ascertain whether the client 250 associated with the request isauthorized to access the particular database. Platform 200 may determinesuch authorization by, for example, evaluating an identity, password orother credential against credentials associated with the particulardatabase, or evaluating the requested access to the particular databaseagainst an access control list for the particular database. For example,if a client 250 does not have sufficient credentials to access theparticular database, platform 200 may reject the corresponding webservices request, for example by returning a response to the requestingclient 250 indicating an error condition. Various access controlpolicies may be stored as records or lists of access control informationby database service 210, distributed database-optimized storage service220 and/or other virtual computing services 230.

It is noted that while web services platform 200 may represent theprimary interface through which clients 250 may access the features of adatabase system that implements database service 210, it need notrepresent the sole interface to such features. For example, an alternateAPI that may be distinct from a web services interface may be used toallow clients internal to the enterprise providing the database systemto bypass web services platform 200. Note that in many of the examplesdescribed herein, distributed database-optimized storage service 220 maybe internal to a computing system or an enterprise system that providesdatabase services to clients 250, and may not be exposed to externalclients (e.g., users or client applications). In such embodiments, theinternal “client” (e.g., database service 210) may access distributeddatabase-optimized storage service 220 over a local or private network,shown as the solid line between distributed database-optimized storageservice 220 and database service 210 (e.g., through an API directlybetween the systems that implement these services). In such embodiments,the use of distributed database-optimized storage service 220 in storingdatabases on behalf of clients 250 may be transparent to those clients.In other embodiments, distributed database-optimized storage service 220may be exposed to clients 250 through web services platform 200 toprovide storage of databases or other information for applications otherthan those that rely on database service 210 for database management.This is illustrated in FIG. 2 by the dashed line between web servicesplatform 200 and distributed database-optimized storage service 220. Insuch embodiments, clients of the distributed database-optimized storageservice 220 may access distributed database-optimized storage service220 via network 260 (e.g., over the Internet). In some embodiments, avirtual computing service 230 may be configured to receive storageservices from distributed database-optimized storage service 220 (e.g.,through an API directly between the virtual computing service 230 anddistributed database-optimized storage service 220) to store objectsused in performing computing services 230 on behalf of a client 250.This is illustrated in FIG. 2 by the dashed line between virtualcomputing service 230 and distributed database-optimized storage service220. In some cases, the accounting and/or credentialing services ofplatform 200 may be unnecessary for internal clients such asadministrative clients or between service components within the sameenterprise.

Note that in various embodiments, different storage policies may beimplemented by database service 210 and/or distributeddatabase-optimized storage service 220. Examples of such storagepolicies may include a durability policy (e.g., a policy indicating thenumber of instances of a database (or data page thereof) that will bestored and the number of different nodes on which they will be stored)and/or a load balancing policy (which may distribute databases, or datapages thereof, across different nodes, volumes and/or disks in anattempt to equalize request traffic). In addition, different storagepolicies may be applied to different types of stored items by variousone of the services. For example, in some embodiments, distributeddatabase-optimized storage service 220 may implement a higher durabilityfor redo log records than for data pages.

FIG. 3 is a block diagram illustrating various components of a databasesystem that includes a database engine and a separate distributeddatabase storage service, according to one embodiment. In this example,database system 300 includes a respective database engine head node 320for each of several databases and a distributed database-optimizedstorage service 310 (which may or may not be visible to the clients ofthe database system, shown as database clients 350 a-350 n). Asillustrated in this example, one or more of database clients 350 a-350 nmay access a database head node 320 (e.g., head node 320 a, head node320 b, or head node 320 c, each of which is a component of a respectivedatabase instance) via network 360 (e.g., these components may benetwork-addressable and accessible to the database clients 350 a-350 n).However, distributed database-optimized storage service 310, which maybe employed by the database system to store data pages of one or moredatabases (and redo log records and/or other metadata associatedtherewith) on behalf of database clients 350 a-350 n, and to performother functions of the database system as described herein, may or maynot be network-addressable and accessible to the storage clients 350a-350 n, in different embodiments. For example, in some embodiments,distributed database-optimized storage service 310 may perform variousstorage, access, change logging, recovery, log record manipulation,and/or space management operations in a manner that is invisible tostorage clients 350 a-350 n.

As previously noted, each database instance may include a singledatabase engine head node 320 that receives requests (e.g., a snapshotrequest, etc.) from various client programs (e.g., applications) and/orsubscribers (users), then parses them, optimizes them, and develops anexecution plan to carry out the associated database operation(s). In theexample illustrated in FIG. 3, a query parsing, optimization, andexecution component 305 of database engine head node 320 a may performthese functions for queries that are received from database client 350 aand that target the database instance of which database engine head node320 a is a component. In some embodiments, query parsing, optimization,and execution component 305 may return query responses to databaseclient 350 a, which may include write acknowledgements, requested datapages (or portions thereof), error messages, and or other responses, asappropriate. As illustrated in this example, database engine head node320 a may also include a client-side storage service driver 325, whichmay route read requests and/or redo log records to various storage nodeswithin distributed database-optimized storage service 310, receive writeacknowledgements from distributed database-optimized storage service310, receive requested data pages from distributed database-optimizedstorage service 310, and/or return data pages, error messages, or otherresponses to query parsing, optimization, and execution component 305(which may, in turn, return them to database client 350 a).

In this example, database engine head node 320 a includes a data pagecache 335, in which data pages that were recently accessed may betemporarily held. As illustrated in FIG. 3, database engine head node320 a may also include a transaction and consistency managementcomponent 330, which may be responsible for providing transactionalityand consistency in the database instance of which database engine headnode 320 a is a component. For example, this component may beresponsible for ensuring the Atomicity, Consistency, and Isolationproperties of the database instance and the transactions that aredirected that the database instance. As illustrated in FIG. 3, databaseengine head node 320 a may also include a transaction log 340 and anundo log 345, which may be employed by transaction and consistencymanagement component 330 to track the status of various transactions androll back any locally cached results of transactions that do not commit.

Note that each of the other database engine head nodes 320 illustratedin FIG. 3 (e.g., 320 b and 320 c) may include similar components and mayperform similar functions for queries received by one or more ofdatabase clients 350 a-350 n and directed to the respective databaseinstances of which it is a component.

In some embodiments, the distributed database-optimized storage systemsdescribed herein may organize data in various logical volumes, segments,and pages for storage on one or more storage nodes. For example, in someembodiments, each databases is represented by a logical volume, and eachlogical volume is segmented over a collection of storage nodes. Eachsegment, which lives on a particular one of the storage nodes, containsa set of contiguous block addresses. In some embodiments, each data pageis stored in a segment, such that each segment stores a collection ofone or more data pages and a change log (also referred to as a redo log)(e.g., a log of redo log records) for each data page that it stores. Asdescribed in detail herein, the storage nodes may be configured toreceive redo log records (which may also be referred to herein as ULRs)and to coalesce them to create new versions of the corresponding datapages and/or additional or replacement log records (e.g., lazily and/orin response to a request for a data page or a database crash). In someembodiments, data pages and/or change logs may be mirrored acrossmultiple storage nodes, according to a variable configuration (which maybe specified by the client on whose behalf the databases is beingmaintained in the database system). For example, in differentembodiments, one, two, or three copies of the data or change logs may bestored in each of one, two, or three different availability zones orregions, according to a default configuration, an application-specificdurability preference, or a client-specified durability preference.

As used herein, the following terms may be used to describe theorganization of data by a distributed database-optimized storage system,according to various embodiments.

Volume: A volume is a logical concept representing a highly durable unitof storage that a user/client/application of the storage systemunderstands. More specifically, a volume is a distributed store thatappears to the user/client/application as a single consistent orderedlog of write operations to various user pages of a database. Each writeoperation may be encoded in a User Log Record (ULR), which represents alogical, ordered mutation to the contents of a single user page withinthe volume. As noted above, a ULR may also be referred to herein as aredo log record. Each ULR may include a unique identifier (e.g., aLogical Sequence Number (LSN)). Each ULR may be persisted to one or moresynchronous segments in the distributed store that form a ProtectionGroup (PG), to provide high durability and availability for the ULR. Avolume may provide an LSN-type read/write interface for a variable-sizecontiguous range of bytes.

In some embodiments, a volume may consist of multiple extents, each madedurable through a protection group. In such embodiments, a volume mayrepresent a unit of storage composed of a mutable contiguous sequence ofVolume Extents. Reads and writes that are directed to a volume may bemapped into corresponding reads and writes to the constituent volumeextents. In some embodiments, the size of a volume may be changed byadding or removing volume extents from the end of the volume.

Segment: A segment is a limited-durability unit of storage assigned to asingle storage node. More specifically, a segment provides limitedbest-effort durability (e.g., a persistent, but non-redundant singlepoint of failure that is a storage node) for a specific fixed-size byterange of data. This data may in some cases be a mirror ofuser-addressable data, or it may be other data, such as volume metadataor erasure coded bits, in various embodiments. A given segment may liveon exactly one storage node. Within a storage node, multiple segmentsmay live on each SSD, and each segment may be restricted to one SSD(e.g., a segment may not span across multiple SSDs). In someembodiments, a segment may not be required to occupy a contiguous regionon an SSD; rather there may be an allocation map in each SSD describingthe areas that are owned by each of the segments. As noted above, aprotection group may consist of multiple segments spread across multiplestorage nodes. In some embodiments, a segment may provide an LSN-typeread/write interface for a fixed-size contiguous range of bytes (wherethe size is defined at creation). In some embodiments, each segment maybe identified by a Segment UUID (e.g., a universally unique identifierof the segment).

Storage page: A storage page is a block of memory, generally of fixedsize. In some embodiments, each page is a block of memory (e.g., ofvirtual memory, disk, or other physical memory) of a size defined by theoperating system, and may also be referred to herein by the term “datablock”. More specifically, a storage page may be a set of contiguoussectors. It may serve as the unit of allocation in SSDs, as well as theunit in log pages for which there is a header and metadata. In someembodiments, and in the context of the database systems describedherein, the term “page” or “storage page” may refer to a similar blockof a size defined by the database configuration, which may typically amultiple of 2, such as 4096, 8192, 16384, or 32768 bytes.

Log page: A log page is a type of storage page that is used to store logrecords (e.g., redo log records or undo log records). In someembodiments, log pages may be identical in size to storage pages. Eachlog page may include a header containing metadata about that log page,e.g., metadata identifying the segment to which it belongs. Note that alog page is a unit of organization and may not necessarily be the unitof data included in write operations. For example, in some embodiments,during normal forward processing, write operations may write to the tailof the log one sector at a time.

Log Records: Log records (e.g., the individual elements of a log page)may be of several different classes. For example, User Log Records(ULRs), which are created and understood by users/clients/applicationsof the storage system, may be used to indicate changes to user data in avolume. Control Log Records (CLRs), which are generated by the storagesystem, may contain control information used to keep track of metadatasuch as the current unconditional volume durable LSN (VDL). Null LogRecords (NLRs) may in some embodiments be used as padding to fill inunused space in a log sector or log page. In some embodiments, there maybe various types of log records within each of these classes, and thetype of a log record may correspond to a function that needs to beinvoked to interpret the log record. For example, one type may representall the data of a user page in compressed format using a specificcompression format; a second type may represent new values for a byterange within a user page; a third type may represent an incrementoperation to a sequence of bytes interpreted as an integer; and a fourthtype may represent copying one byte range to another location within thepage. In some embodiments, log record types may be identified by GUIDs(rather than by integers or enums), which may simplify versioning anddevelopment, especially for ULRs.

Payload: The payload of a log record is the data or parameter valuesthat are specific to the log record or to log records of a particulartype. For example, in some embodiments, there may be a set of parametersor attributes that most (or all) log records include, and that thestorage system itself understands. These attributes may be part of acommon log record header/structure, which may be relatively smallcompared to the sector size. In addition, most log records may includeadditional parameters or data specific to that log record type, and thisadditional information may be considered the payload of that log record.In some embodiments, if the payload for a particular ULR is larger thanthe user page size, it may be replaced by an absolute ULR (an AULR)whose payload includes all the data for the user page. This may enablethe storage system to enforce an upper limit on the size of the payloadfor ULRs that is equal to the size of user pages.

Note that when storing log records in the segment log, the payload maybe stored along with the log header, in some embodiments. In otherembodiments, the payload may be stored in a separate location, andpointers to the location at which that payload is stored may be storedwith the log header. In still other embodiments, a portion of thepayload may be stored in the header, and the remainder of the payloadmay be stored in a separate location. If the entire payload is storedwith the log header, this may be referred to as in-band storage;otherwise the storage may be referred to as being out-of-band. In someembodiments, the payloads of most large AULRs may be stored out-of-bandin the cold zone of log (which is described below).

User pages: User pages are the byte ranges (of a fixed size) andalignments thereof for a particular volume that are visible tousers/clients of the storage system. User pages are a logical concept,and the bytes in particular user pages may or not be stored in anystorage page as-is. The size of the user pages for a particular volumemay be independent of the storage page size for that volume. In someembodiments, the user page size may be configurable per volume, anddifferent segments on a storage node may have different user page sizes.In some embodiments, user page sizes may be constrained to be a multipleof the sector size (e.g., 4 KB), and may have an upper limit (e.g., 64KB). The storage page size, on the other hand, may be fixed for anentire storage node and may not change unless there is a change to theunderlying hardware.

Data page: A data page is a type of storage page that is used to storeuser page data in compressed form. In some embodiments every piece ofdata stored in a data page is associated with a log record, and each logrecord may include a pointer to a sector within a data page (alsoreferred to as a data sector). In some embodiments, data pages may notinclude any embedded metadata other than that provided by each sector.There may be no relationship between the sectors in a data page.Instead, the organization into pages may exist only as an expression ofthe granularity of the allocation of data to a segment.

Storage node: A storage node is a single virtual machine that on whichstorage node server code is deployed. Each storage node may containmultiple locally attached SSDs, and may provide a network API for accessto one or more segments. In some embodiments, various nodes may be on anactive list or on a degraded list (e.g., if they are slow to respond orare otherwise impaired, but are not completely unusable). In someembodiments, the client-side driver may assist in (or be responsiblefor) classifying nodes as active or degraded, for determining if andwhen they should be replaced, and/or for determining when and how toredistribute data among various nodes, based on observed performance.

SSD: As referred to herein, the term “SSD” may refer to a local blockstorage volume as seen by the storage node, regardless of the type ofstorage employed by that storage volume, e.g., disk, a solid-statedrive, a battery-backed RAM, a non-volatile RAM device (e.g., one ormore NV-DIMMs) or another type of persistent storage device. An SSD isnot necessarily mapped directly to hardware. For example, a singlesolid-state storage device might be broken up into multiple localvolumes where each volume is split into and striped across multiplesegments, and/or a single drive may be broken up into multiple volumessimply for ease of management, in different embodiments. In someembodiments, each SSD may store an allocation map at a single fixedlocation. This map may indicate which storage pages that are owned byparticular segments, and which of these pages are log pages (as opposedto data pages). In some embodiments, storage pages may be pre-allocatedto each segment so that forward processing may not need to wait forallocation. Any changes to the allocation map may need to be madedurable before newly allocated storage pages are used by the segments.

One embodiment of a distributed database-optimized storage system isillustrated by the block diagram in FIG. 4. In this example, a databasesystem 400 includes a distributed database-optimized storage system 410,which communicates with a database engine head node 420 overinterconnect 460. As in the example illustrated in FIG. 3, databaseengine head node 420 may include a client-side storage service driver425. In this example, distributed database-optimized storage system 410includes multiple storage system server nodes (including those shown as430, 440, and 450), each of which includes storage for data pages andredo logs for the segment(s) it stores, and hardware and/or softwareconfigured to perform various segment management functions. For example,each storage system server node may include hardware and/or softwareconfigured to perform at least a portion of any or all of the followingoperations: replication (locally, e.g., within the storage node),coalescing of redo logs to generate data pages, snapshots (e.g.,creating, restoration, deletion, etc.), log management (e.g.,manipulating log records), crash recovery, and/or space management(e.g., for a segment). Each storage system server node may also havemultiple attached storage devices (e.g., SSDs) on which data blocks maybe stored on behalf of clients (e.g., users, client applications, and/ordatabase service subscribers).

In the example illustrated in FIG. 4, storage system server node 430includes data page(s) 433, segment redo log(s) 435, segment managementfunctions 437, and attached SSDs 471-478. Again note that the label“SSD” may or may not refer to a solid-state drive, but may moregenerally refer to a local block storage volume, regardless of itsunderlying hardware. Similarly, storage system server node 440 includesdata page(s) 443, segment redo log(s) 445, segment management functions447, and attached SSDs 481-488; and storage system server node 450includes data page(s) 453, segment redo log(s) 455, segment managementfunctions 457, and attached SSDs 491-498.

As previously noted, in some embodiments, a sector is the unit ofalignment on an SSD and may be the maximum size on an SSD that can bewritten without the risk that the write will only be partiallycompleted. For example, the sector size for various solid-state drivesand spinning media may be 4 KB. In some embodiments of the distributeddatabase-optimized storage systems described herein, each and everysector may include have a 64-bit (8 byte) CRC at the beginning of thesector, regardless of the higher-level entity of which the sector is apart. In such embodiments, this CRC (which may be validated every time asector is read from SSD) may be used in detecting corruptions. In someembodiments, each and every sector may also include a “sector type” bytewhose value identifies the sector as a log sector, a data sector, or anuninitialized sector. For example, in some embodiments, a sector typebyte value of 0 may indicate that the sector is uninitialized.

In some embodiments, each of the storage system server nodes in thedistributed database-optimized storage system may implement a set ofprocesses running on the node server's operating system that managecommunication with the database engine head node, e.g., to receive redologs, send back data pages, etc. In some embodiments, all data blockswritten to the distributed database-optimized storage system may bebacked up to long-term and/or archival storage (e.g., in a remotekey-value durable backup storage system).

FIG. 5 is a block diagram illustrating the use of a separate distributeddatabase-optimized storage system in a database system, according to oneembodiment. In this example, one or more client processes 510 may storedata to one or more databases maintained by a database system thatincludes a database engine 520 and a distributed database-optimizedstorage system 530. In the example illustrated in FIG. 5, databaseengine 520 includes database tier components 560 and client-side driver540 (which serves as the interface between distributeddatabase-optimized storage system 530 and database tier components 560).In some embodiments, database tier components 560 may perform functionssuch as those performed by query parsing, optimization and executioncomponent 305 and transaction and consistency management component 330of FIG. 3, and/or may store data pages, transaction logs and/or undologs (such as those stored by data page cache 335, transaction log 340and undo log 345 of FIG. 3).

In this example, one or more client processes 510 may send databasequery requests 515 (which may include read and/or write requeststargeting data stored on one or more of the storage nodes 535 a-535 n)to database tier components 560, and may receive database queryresponses 517 from database tier components 560 (e.g., responses thatinclude write acknowledgements and/or requested data). Each databasequery request 515 that includes a request to write to a data page may beparsed and optimized to generate one or more write record requests 541,which may be sent to client-side driver 540 for subsequent routing todistributed database-optimized storage system 530.

In this example, client-side driver 540 may generate one or more redolog records 531 corresponding to each write record request 541, and maysend them to specific ones of the storage nodes 535 of distributeddatabase-optimized storage system 530. Distributed database-optimizedstorage system 530 may return a corresponding write acknowledgement 532for each redo log record 531 to database engine 520 (specifically toclient-side driver 540). Client-side driver 540 may pass these writeacknowledgements to database tier components 560 (as write responses542), which may then send corresponding responses (e.g., writeacknowledgements) to one or more client processes 510 as one of databasequery responses 517.

In this example, each database query request 515 that includes a requestto read a data page may be parsed and optimized to generate one or moreread record requests 543, which may be sent to client-side driver 540for subsequent routing to distributed database-optimized storage system530. In this example, client-side driver 540 may send these requests tospecific ones of the storage nodes 535 of distributed database-optimizedstorage system 530, and distributed database-optimized storage system530 may return the requested data pages 533 to database engine 520(specifically to client-side driver 540). Client-side driver 540 maysend the returned data pages to the database tier components 560 asreturn data records 544, and database tier components 560 may then sendthe data pages to one or more client processes 510 as database queryresponses 517.

In some embodiments, various error and/or data loss messages 534 may besent from distributed database-optimized storage system 530 to databaseengine 520 (specifically to client-side driver 540). These messages maybe passed from client-side driver 540 to database tier components 560 aserror and/or loss reporting messages 545, and then to one or more clientprocesses 510 along with (or instead of) a database query response 517.

In some embodiments, the APIs 531-534 of distributed database-optimizedstorage system 530 and the APIs 541-545 of client-side driver 540 mayexpose the functionality of the distributed database-optimized storagesystem 530 to database engine 520 as if database engine 520 were aclient of distributed database-optimized storage system 530. Forexample, database engine 520 (through client-side driver 540) may writeredo log records or request data pages through these APIs to perform (orfacilitate the performance of) various operations of the database systemimplemented by the combination of database engine 520 and distributeddatabase-optimized storage system 530 (e.g., storage, access, changelogging, recovery, and/or space management operations). As illustratedin FIG. 5, distributed database-optimized storage system 530 may storedata blocks on storage nodes 535 a-535 n, each of which may havemultiple attached SSDs. In some embodiments, distributeddatabase-optimized storage system 530 may provide high durability forstored data block through the application of various types of redundancyschemes.

Note that in various embodiments, the API calls and responses betweendatabase engine 520 and distributed database-optimized storage system530 (e.g., APIs 531-534) and/or the API calls and responses betweenclient-side driver 540 and database tier components 560 (e.g., APIs541-545) in FIG. 5 may be performed over a secure proxy connection(e.g., one managed by a gateway control plane), or may be performed overthe public network or, alternatively, over a private channel such as avirtual private network (VPN) connection. These and other APIs to and/orbetween components of the database systems described herein may beimplemented according to different technologies, including, but notlimited to, Simple Object Access Protocol (SOAP) technology andRepresentational state transfer (REST) technology. For example, theseAPIs may be, but are not necessarily, implemented as SOAP APIs orRESTful APIs. SOAP is a protocol for exchanging information in thecontext of Web-based services. REST is an architectural style fordistributed hypermedia systems. A RESTful API (which may also bereferred to as a RESTful web service) is a web service API implementedusing HTTP and REST technology. The APIs described herein may in someembodiments be wrapped with client libraries in various languages,including, but not limited to, C, C++, Java, C# and Perl to supportintegration with database engine 520 and/or distributeddatabase-optimized storage system 530.

As noted above, in some embodiments, the functional components of adatabase system may be partitioned between those that are performed bythe database engine and those that are performed in a separate,distributed, database-optimized storage system. In one specific example,in response to receiving a request from a client process (or a threadthereof) to insert something into a database (e.g., to update a singledata block by adding a record to that data block), one or morecomponents of the database engine head node may perform query parsing,optimization, and execution, and may send each portion of the query to atransaction and consistency management component. The transaction andconsistency management component may ensure that no other client process(or thread thereof) is trying to modify the same row at the same time.For example, the transaction and consistency management component may beresponsible for ensuring that this change is performed atomically,consistently, durably, and in an isolated manner in the database. Forexample, the transaction and consistency management component may worktogether with the client-side storage service driver of the databaseengine head node to generate a redo log record to be sent to one of thenodes in the distributed database-optimized storage service and to sendit to the distributed database-optimized storage service (along withother redo logs generated in response to other client requests) in anorder and/or with timing that ensures the ACID properties are met forthis transaction. Upon receiving the redo log record (which may beconsidered an “update record” by the storage service), the correspondingstorage node may update the data block, and may update a redo log forthe data block (e.g., a record of all changes directed to the datablock). In some embodiments, the database engine may be responsible forgenerating an undo log record for this change, and may also beresponsible for generating a redo log record for the undo log both ofwhich may be used locally (in the database tier) for ensuringtransactionality. However, unlike in traditional database systems, thesystems described herein may shift the responsibility for applyingchanges to data blocks to the storage system (rather than applying themat the database tier and shipping the modified data blocks to thestorage system). Moreover, as described herein at FIGS. 8-9B, in variousembodiments, system-wide checkpoint may be avoided at the databasesystem along with fast recovery from a database system crash due tovarious log record operations that may be performed by the storagesystem as well.

A variety of different allocation models may be implemented for an SSD,in different embodiments. For example, in some embodiments, log entrypages and physical application pages may be allocated from a single heapof pages associated with an SSD device. This approach may have theadvantage of leaving the relative amount of storage consumed by logpages and data pages to remain unspecified and to adapt automatically tousage. It may also have the advantage of allowing pages to remainunprepared until they are used, and repurposed at will withoutpreparation. In other embodiments, an allocation model may partition thestorage device into separate spaces for log entries and data pages. Oncesuch allocation model is illustrated by the block diagram in FIG. 6 anddescribed below.

FIG. 6 is a block diagram illustrating how data and metadata may bestored on a given storage node (or persistent storage device) of adistributed database-optimized storage system, according to oneembodiment. In this example, SSD storage space 600 stores an SSD headerand other fixed metadata in the portion of the space labeled 610. Itstores log pages in the portion of the space labeled 620, and includes aspace labeled 630 that is initialized and reserved for additional logpages. One portion of SSD storage space 600 (shown as 640) isinitialized, but unassigned, and another portion of the space (shown as650) is uninitialized and unassigned. Finally, the portion of SSDstorage space 600 labeled 660 stores data pages.

In this example, the first usable log page slot is noted as 615, and thelast used log page slot (ephemeral) is noted as 625. The last reservedlog page slot is noted as 635, and the last usable log page slot isnoted as 645. In this example, the first used data page slot (ephemeral)is noted as 665. In some embodiments, the positions of each of theseelements (615, 625, 635, 645, and 665) within SSD storage space 600 maybe identified by a respective pointer.

In allocation approach illustrated in FIG. 6, valid log pages may bepacked into the beginning of the flat storage space. Holes that open updue to log pages being freed may be reused before additional log pageslots farther into the address space are used. For example, in the worstcase, the first n log page slots contain valid log data, where n is thelargest number of valid log pages that have ever simultaneously existed.In this example, valid data pages may be packed into the end of the flatstorage space. Holes that open up due to data pages being freed may bereused before additional data page slots lower in the address space areused. For example, in the worst case, the last m data pages containvalid data, where m is the largest number of valid data pages that haveever simultaneously existed.

In some embodiments, before a log page slot can become part of thepotential set of valid log page entries, it may need to be initializedto a value that cannot be confused for a valid future log entry page.This is implicitly true for recycled log page slots, since a retired logpage has enough metadata to never be confused for a new valid log page.However, when a storage device is first initialized, or when space isreclaimed that had potentially been used to store application datapages, the log page slots may need to be initialized before they areadded to the log page slot pool. In some embodiments,rebalancing/reclaiming log space may be performed as a background task.

In the example illustrated in FIG. 6, the current log page slot poolincludes the area between the first usable log page slot (at 615) andthe last reserved log page slot (625). In some embodiments, this poolmay safely grow up to last usable log page slot (625) withoutre-initialization of new log page slots (e.g., by persisting an updateto the pointer that identifies the last reserved log page slot, 635). Inthis example, beyond the last usable log page slot (which is identifiedby pointer 645), the pool may grow up to the first used data page slot(which is identified by pointer 665) by persisting initialized log pageslots and persistently updating the pointer for the last usable log pageslot (645). In this example, the previously uninitialized and unassignedportion of the SSD storage space 600 shown as 650 may be pressed intoservice to store log pages. In some embodiments, the current log pageslot pool may be shrunk down to the position of the last used log pageslot (which is identified by pointer) by persisting an update to thepointer for the last reserved log page slot (635).

In the example illustrated in FIG. 6, the current data page slot poolincludes the area between the last usable log page slot (which isidentified by pointer 645) and the end of SSD storage space 600. In someembodiments, the data page pool may be safely grown to the positionidentified by the pointer to the last reserved log page slot (635) bypersisting an update to the pointer to the last usable log page slot(645). In this example, the previously initialized, but unassignedportion of the SSD storage space 600 shown as 640 may be pressed intoservice to store data pages. Beyond this, the pool may be safely grownto the position identified by the pointer to the last used log page slot(625) by persisting updates to the pointers for the last reserved logpage slot (635) and the last usable log page slot (645), effectivelyreassigning the portions of SSD storage space 600 shown as 630 and 640to store data pages, rather than log pages. In some embodiments, thedata page slot pool may be safely shrunk down to the position identifiedby the pointer to the first used data page slot (665) by initializingadditional log page slots and persisting an update to the pointer to thelast usable log page slot (645).

In embodiments that employ the allocation approach illustrated in FIG.6, page sizes for the log page pool and the data page pool may beselected independently, while still facilitating good packing behavior.In such embodiments, there may be no possibility of a valid log pagelinking to a spoofed log page formed by application data, and it may bepossible to distinguish between a corrupted log and a valid log tailthat links to an as-yet-unwritten next page. In embodiments that employthe allocation approach illustrated in FIG. 6, at startup, all of thelog page slots up to the position identified by the pointer to the lastreserved log page slot (635) may be rapidly and sequentially read, andthe entire log index may be reconstructed (including inferredlinking/ordering). In such embodiments, there may be no need forexplicit linking between log pages, since everything can be inferredfrom LSN sequencing constraints.

In some embodiments, a segment may consist of three main parts (orzones): one that contains a hot log, one that contains a cold log, andone that contains user page data. Zones are not necessarily contiguousregions of an SSD. Rather, they can be interspersed at the granularityof the storage page. In addition, there may be a root page for eachsegment that stores metadata about the segment and its properties. Forexample, the root page for a segment may store the user page size forthe segment, the number of user pages in the segment, the currentbeginning/head of the hot log zone (which may be recorded in the form ofa flush number), the volume epoch, and/or access control metadata.

In some embodiments, the hot log zone may accept new writes from theclient as they are received by the storage node. Both Delta User LogRecords (DULRs), which specify a change to a user/data page in the formof a delta from the previous version of the page, and Absolute User LogRecords (AULRs), which specify the contents of a complete user/datapage, may be written completely into the log. Log records may be addedto this zone in approximately the order they are received (e.g., theyare not sorted by LSN) and they can span across log pages. The logrecords may be self-describing, e.g., they may contain an indication oftheir own size. In some embodiments, no garbage collection is performedin this zone. Instead, space may be reclaimed by truncating from thebeginning of the log after all required log records have been copiedinto the cold log. Log sectors in the hot zone may be annotated with themost recent known unconditional VDL each time a sector is written.Conditional VDL CLRs may be written into the hot zone as they arereceived, but only the most recently written VDL CLR may be meaningful.

In some embodiments, every time a new log page is written, it may beassigned a flush number. The flush number may be written as part ofevery sector within each log page. Flush numbers may be used todetermine which log page was written later when comparing two log pages.Flush numbers are monotonically increasing and scoped to an SSD (orstorage node). For example, a set of monotonically increasing flushnumbers is shared between all segments on an SSD (or all segments on astorage node).

In some embodiments, in the cold log zone, log records may be stored inincreasing order of their LSNs. In this zone, AULRs may not necessarilystore data in-line, depending on their size. For example, if they havelarge payloads, all or a portion of the payloads may be stored in thedata zone and they may point to where their data is stored in the datazone. In some embodiments, log pages in the cold log zone may be writtenone full page at a time, rather than sector-by-sector. Because log pagesin the cold zone are written a full page at a time, any log page in thecold zone for which the flush numbers in all sectors are not identicalmay be considered to be an incompletely written page and may be ignored.In some embodiments, in the cold log zone, DULRs may be able to spanacross log pages (up to a maximum of two log pages). However, AULRs maynot be able to span log sectors, e.g., so that a coalesce operation willbe able to replace a DULR with an AULR in a single atomic write.

In some embodiments, the cold log zone is populated by copying logrecords from the hot log zone. In such embodiments, only log recordswhose LSN is less than or equal to the current unconditional volumedurable LSN (VDL) may be eligible to be copied to the cold log zone.When moving log records from the hot log zone to the cold log zone, somelog records (such as many CLRs) may not need to be copied because theyare no longer necessary. In addition, some additional coalescing of userpages may be performed at this point, which may reduce the amount ofcopying required. In some embodiments, once a given hot zone log pagehas been completely written and is no longer the newest hot zone logpage, and all ULRs on the hot zone log page have been successfullycopied to the cold log zone, the hot zone log page may be freed andreused.

In some embodiments, garbage collection may be done in the cold log zoneto reclaim space occupied by obsolete log records, e.g., log recordsthat no longer need to be stored in the SSDs of the storage tier. Forexample, a log record may become obsolete when there is a subsequentAULR for the same user page and the version of the user page representedby the log record is not needed for retention on SSD. In someembodiments, a garbage collection process may reclaim space by mergingtwo or more adjacent log pages and replacing them with fewer new logpages containing all of the non-obsolete log records from the log pagesthat they are replacing. The new log pages may be assigned new flushnumbers that are larger than the flush numbers of the log pages they arereplacing. After the write of these new log pages is complete, thereplaced log pages may be added to the free page pool. Note that in someembodiments, there may not be any explicit chaining of log pages usingany pointers. Instead, the sequence of log pages may be implicitlydetermined by the flush numbers on those pages. Whenever multiple copiesof a log record are found, the log record present in the log page withhighest flush number may be considered to be valid and the others may beconsidered to be obsolete.

In some embodiments, e.g., because the granularity of space managedwithin a data zone (sector) may be different from the granularityoutside the data zone (storage page), there may be some fragmentation.In some embodiments, to keep this fragmentation under control, thesystem may keep track of the number of sectors used by each data page,may preferentially allocate from almost-full data pages, and maypreferentially garbage collect almost-empty data pages (which mayrequire moving data to a new location if it is still relevant). Notethat pages allocated to a segment may in some embodiments be repurposedamong the three zones. For example, when a page that was allocated to asegment is freed, it may remain associated with that segment for someperiod of time and may subsequently be used in any of the three zones ofthat segment. The sector header of every sector may indicate the zone towhich the sector belongs. Once all sectors in a page are free, the pagemay be returned to a common free storage page pool that is shared acrosszones. This free storage page sharing may in some embodiments reduce (oravoid) fragmentation.

In some embodiments, the distributed database-optimized storage systemsdescribed herein may maintain various data structures in memory. Forexample, for each user page present in a segment, a user page table maystore a bit indicating whether or not this user page is “cleared” (i.e.,whether it includes all zeroes), the LSN of the latest log record fromthe cold log zone for the page, and an array/list of locations of alllog records from the hot log zone for page. For each log record, theuser page table may store the sector number, the offset of the logrecord within that sector, the number of sectors to read within that logpage, the sector number of a second log page (if the log record spanslog pages), and the number of sectors to read within that log page. Insome embodiments, the user page table may also store the LSNs of everylog record from the cold log zone and/or an array of sector numbers forthe payload of the latest AULR if it is in the cold log zone.

In some embodiments of the distributed database-optimized storagesystems described herein, an LSN index may be stored in memory. An LSNindex may map LSNs to log pages within the cold log zone. Given that logrecords in cold log zone are sorted, it may be to include one entry perlog page. However, in some embodiments, every non-obsolete LSN may bestored in the index and mapped to the corresponding sector numbers,offsets, and numbers of sectors for each log record.

In some embodiments of the distributed database-optimized storagesystems described herein, a log page table may be stored in memory, andthe log page table may be used during garbage collection of the cold logzone. For example, the log page table may identify which log records areobsolete (e.g., which log records can be garbage collected) and how muchfree space is available on each log page.

In the storage systems described herein, an extent may be a logicalconcept representing a highly durable unit of storage that can becombined with other extents (either concatenated or striped) torepresent a volume. Each extent may be made durable by membership in asingle protection group. An extent may provide an LSN-type read/writeinterface for a contiguous byte sub-range having a fixed size that isdefined at creation. Read/write operations to an extent may be mappedinto one or more appropriate segment read/write operations by thecontaining protection group. As used herein, the term “volume extent”may refer to an extent that is used to represent a specific sub-range ofbytes within a volume.

As noted above, a volume may consist of multiple extents, eachrepresented by a protection group consisting of one or more segments. Insome embodiments, log records directed to different extents may haveinterleaved LSNs. For changes to the volume to be durable up to aparticular LSN it may be necessary for all log records up to that LSN tobe durable, regardless of the extent to which they belong. In someembodiments, the client may keep track of outstanding log records thathave not yet been made durable, and once all ULRs up to a specific LSNare made durable, it may send a Volume Durable LSN (VDL) message to oneof the protection groups in the volume. The VDL may be written to allsynchronous mirror segments for the protection group. This is sometimesreferred to as an “Unconditional VDL” and it may be periodicallypersisted to various segments (or more specifically, to variousprotection groups) along with write activity happening on the segments.In some embodiments, the Unconditional VDL may be stored in log sectorheaders.

In various embodiments, the operations that may be performed on asegment may include writing a DULR or AULR received from a client (whichmay involve writing the DULR or AULR to the tail of the hot log zone andthen updating the user page table), reading a cold user page (which mayinvolve locating the data sectors of the user page and returning themwithout needing to apply any additional DULRs), reading a hot user page(which may involve locating the data sectors of the most recent AULR forthe user page and apply any subsequent DULRs to the user page beforereturning it), replacing DULRs with AULRs (which may involve coalescingDULRs for a user page to create an AULR that replaces the last DULR thatwas applied), manipulating the log records, etc. As described hereincoalescing is the process of applying DULRs to an earlier version of auser page to create a later version of the user page. Coalescing a userpage may help reduce read latency because (until another DULR iswritten) all DULRs written prior to coalescing may not need to be readand applied on demand. It may also help reclaim storage space by makingold AULRs and DULRs obsolete (provided there is no snapshot requiringthe log records to be present). In some embodiments, a coalescingoperation may include locating a most recent AULR and applying anysubsequent DULRs in sequence without skipping any of the DULRs. As notedabove, in some embodiments, coalescing may not be performed within thehot log zone. Instead, it may be performed within the cold log zone. Insome embodiments, coalescing may also be performed as log records arecopied from the hot log zone to the cold log zone.

In some embodiments, the decision to coalesce a user page may betriggered by the size of the pending DULR chain for the page (e.g., ifthe length of the DULR chain exceeds a pre-defined threshold for acoalescing operation, according to a system-wide, application-specificor client-specified policy)), or by the user page being read by aclient.

FIG. 7 is a block diagram illustrating an example configuration of adatabase volume 710, according to one embodiment. In this example, datacorresponding to each of various address ranges 715 (shown as addressranges 715 a-715 e) is stored as different segments 745 (shown assegments 745 a-745 n). More specifically, data corresponding to each ofvarious address ranges 715 may be organized into different extents(shown as extents 725 a-725 b, and extents 735 a-735 h), and variousones of these extents may be included in different protection groups 730(shown as 730 a-730 f), with or without striping (such as that shown asstripe set 720 a and stripe set 720 b). In this example, protectiongroup 1 illustrates the use of erasure coding. In this example,protection groups 2 and 3 and protection groups 6 and 7 representmirrored data sets of each other, while protection group 4 represents asingle-instance (non-redundant) data set. In this example, protectiongroup 8 represents a multi-tier protection group that combines otherprotection groups (e.g., this may represent a multi-region protectiongroup). In this example, stripe set 1 (720 a) and stripe set 2 (720 b)illustrates how extents (e.g., extents 725 a and 725 b) may be stripedinto a volume, in some embodiments.

More specifically, in this example, protection group 1 (730 a) includesextents a-c (735 a-735 c), which include data from ranges 1-3 (715 a-715c), respectively, and these extents are mapped to segments 1-4 (745a-745 d). Protection group 2 (730 b) includes extent d (735 d), whichincludes data striped from range 4 (715 d), and this extent is mapped tosegments 5-7 (745 e-745 g). Similarly, protection group 3 (730 c)includes extent e (735 e), which includes data striped from range 4 (715d), and is mapped to segments 8-9 (745 h-745 i); and protection group 4(730 d) includes extent f (735 f), which includes data striped fromrange 4 (715 d), and is mapped to segment 10 (745 j). In this example,protection group 6 (730 e) includes extent g (735 g), which includesdata striped from range 5 (715 e), and is mapped to segments 11-12 (745k-745 l); and protection group 7 (730 f) includes extent h (735 h),which also includes data striped from range 5 (715 e), and is mapped tosegments 13-14 (745 m-745 n).

Turning now to FIG. 8, in various embodiments, as described above, adatabase system may be configured to generate redo log records inresponse to various access requests (e.g., write requests) for datastored within data pages on storage nodes and send the redo log recordsto the storage nodes that store the respective data pages for which theredo log records were generated. Storage nodes may detect a coalesceevent for a particular data page and in response perform a coalesceoperation for the particular data page. A typical database system bycontrast, may apply a system-wide checkpoint that flushes all of thegenerated redo logs to be applied to stored data at periodic intervals,thus disrupting the processing of access requests and other tasksperformed by the database.

While the method of FIG. 8 may be described as being performed byvarious components of a log-structured storage system, such asdistributed database-optimized storage system 410 (e.g. storage systemserver node(s) 430, 440, 450, etc.), the method need not be performed byany specific component in some cases. For instance, in some cases, themethod of FIG. 8 may be performed by some other component or computersystem, according to some embodiments. Or, in some cases, components ofdatabase system 400 may be combined or exist in a different manner thanthat shown in the example of FIG. 4. In various embodiments, the methodof FIG. 8 may be performed by one or more computers of a distributeddatabase-optimized storage system, one of which is shown as the computersystem of FIG. 10. The method of FIG. 8 is shown as one exampleimplementation of a method for system-wide checkpoint avoidance. Inother implementations, the method of FIG. 8 may include additional orfewer blocks than are shown.

As indicated at 810, redo log records linked to a particular data pagestored for a database may be maintained. These redo log records(sometimes referred to as ULRs as described above) may describe a changeto user data. Redo log records may be linked to a particular portion ofuser data, such as a data page. For example, in some embodiments redolog records may form a chain of redo log records ultimately linked to aparticular data page with each redo log record pointing to thepreviously received redo log record for the data page. Using thisexample, if three redo log records are linked to the particular datapage, then the most recently received redo log record will point to thenext most recently received redo log record, which will in turn point tothe third most recently received redo log record, which points to themost recently saved state of the data page. Please note that the logicalordering of the redo log records indicated by each pointer to a priorredo log record does not imply that such redo log records are physicallystored in such an order. As discussed above with regard to FIG. 6, theseredo log records may, in some embodiments, be interleaved with otherredo log records linked to other portions of user data. Therefore, theprevious example is not intended to be limiting.

In various embodiments, redo log records may be received from a databasesystem, such as database engine head node 420, which may manage one ormore databases for which data may be stored at a storage node, such asstorage node 430, 440, 450, etc. However, in at least some embodiments astorage node may receive redo log records from one or more additionaldatabase systems or nodes for which the storage node stores data. Theseother database systems or nodes may also send redo log records linked toparticular portions of data stored for their respective databases at thestorage node.

Received redo log records may then be stored, in some embodiments. FIG.6 describes various embodiments of how such redo log records may bereceived, processed, and stored at a storage node. Various forms ofmetadata may be maintained for the stored redo log records, such as anumber or count of redo log records linked to a particular portion data,such as a data page. For instance, if as in the example given above,three redo log records are linked to a particular data page, then theredo log record count for the particular data page may be maintained atthree. Other metadata concerning redo log records, such as size orphysical location, and the portions of data to which they are linked maybe maintained, such as pointers to various other log records or pointersto the most recently saved state of a data page.

Updates to metadata maintained for the stored redo log records may bemade in response to changes to the redo log records themselves, changesto the particular data page to which they are linked, or operations orother methods or techniques performed by utilizing, or with regard to,the redo log records. For example, if a coalesce operation, as indicatedat 830, is performed applying one or more redo log records linked to aparticular data page to generate a current state of the data page, thenthe redo log record count may be updated to remove those applied redolog records from the redo log record count for the particular data page.

In various embodiments, a coalesce event for the particular data pagemay be detected, as indicated at 820, based, at least in part on the oneor more redo log records linked to the particular data page. A detectedcoalesce event, may indicate that a coalesce operation may be performedfor the particular data page. In at least some embodiments, detecting acoalesce event for a particular data page may occur independently fromor without regard to coalesce events detected for other data pages.Consider the scenario where a particular data page may be a “hot” datapage for which many redo log records are received. Redo log records maybe received vary rarely for other data pages.

Detecting a coalesce event may be based on the number of redo logrecords linked to the respective data page exceeding a coalescethreshold, and thus in this scenario, a coalesce event may be detectedmore frequently for the particular “hot” data page than for the otherdata pages.

Detecting a coalesce event may be performed as part of a storage nodemonitoring component or process that may run as a background processwhere foreground processes that handle read, write, and other accessrequests may be performed prior to (or delaying) the detection of acoalesce event. Detection of the coalesce event may occur at periodic oraperiodic intervals, such as when the workload of the storage node isless than a workload threshold.

Various methods and techniques for detecting coalesce events based, atleast in part on the redo log records linked to the particular data pagemay be implemented. For example, in at least some embodiments, acoalesce threshold may be utilized to detect coalesce events. A coalescethreshold may define a number of redo log records that may be linked toa particular data page before a coalesce event is detected. For example,if a particular data page has 11 redo log records exceeding a coalescethreshold of 10 redo log records, then a coalesce event may be detected.Different coalesce thresholds may be utilized for different data pages.For instance, consider again the “hot” data page scenario that receivesfrequent redo log records linked to the data page. A higher coalescethreshold may be utilized for the “hot” data page, than a data page thatreceives redo log records less frequently, thus reducing the number ofcoalesce operations performed for the “hot” data page. Alternatively, insome embodiments, the same or a similar coalesce threshold may beutilized. A coalesce threshold may also be combined with various othertechniques or components. For example, using other components tocalculate when a coalesce threshold is likely to be exceeded and settinga timer or other component to indicate to a background monitor or otherprocess that performs coalesce event detection that the redo log recordcount for the particular data page should be examined.

In at least some embodiments, the coalesce threshold for a particulardata page may be determined (or for a particular set of data pages). Forexample, in some embodiments, the coalesce threshold may be determinedaccording to a user-defined coalesce threshold. A user-defined coalescethreshold may be coalesce threshold requested, determined, or indicatedto a storage node from a database system, such as a database engine headnode 420, or client of a database system may supply a coalesce thresholdto be used to detect a coalesce event. In some embodiments, a coalescethreshold may be determined based on the workload or performance of astorage node. For instance, in some embodiments, if a workload orperformance measure indicates that the capacity to perform coalesceoperations is low, then the coalesce threshold may be increased suchthat the number of coalesce events detected may be handled by thestorage node at its current workload. In some embodiments, the rate orfrequency that redo log records are received for a particular data pagemay be calculated, and used to determine a coalesce threshold. In atleast some embodiments, various other characteristics may be used todetermine a coalesce threshold, such as the size of redo log records,the location of redo log records in physical storage, the availablespace to store redo log records, and/or the time at which a coalesceoperation may be performed to apply the redo log records to a previouslystored version of the data page.

In response to detecting the coalesce event for the particular datapage, the one or more redo log records linked to the particular datapage may be applied to a previously stored version of the particulardata to generate the particular data page in its current state, asindicated at 830. In at least some embodiments, applying the redo logrecords linked to the particular data page is performed as part of acoalesce operation. A coalesce operation or coalescing as describedabove may apply redo log records, such as DULRs, to an earlier versionof a user page to create a later version of the user page. In someembodiments, a coalesce operation may include locating a most recentAULR (e.g., a previously stored version of a data page) and applying anysubsequent DULRs in sequence without skipping any of the DULRs. Forinstance, if 3 DULRs are received and linked to an AULR, the firstreceived DULR is applied to the AULR (thus applying the first receivedchange relative to the previously stored data page). Then, the nextreceived DULR is applied, and finally the most recent DULR is applied,applying the DULRs in a sequence determined based on receipt of the DULRat the storage node. In some embodiments, a new AULR is generated as thecurrent state of the particular data page. The metadata discussed above,such as the redo log record count, may be updated to reflect theapplication of the redo log records, and with regard to the redo logrecord count, remove their number from the count.

In at least some embodiments, a delay may occur or be enforced betweenthe detection of a coalesce event, indicated at 820, and applying theredo log records, indicated at 830. For example, the workload of astorage node performing said detecting and said applying, may determinea delay between the performance of applying redo log records and thedetection of the coalesce event. Similarly, the application of redo logrecords in response to detecting a coalesce event may be performed aspart of a background process, that is reduced or performed only when notperforming foreground processes, such as handling various accessrequests (e.g., read requests or write requests). Delayed coalesceoperations or application of redo logs for data pages may be enteredinto a data structure such as a first in first out (FIFO) queue orpriority queue, that determines an order, sequence, or timing of whendata pages should have redo log records applied. For example, if as inthe scenario described above, a “hot” data page has a detected coalesceevent, it may be more efficient to perform the application of redo logsto the “hot” data page instead of another data page. As result ofdelaying or performing application of redo log records as a backgroundprocess, one or more additional redo log records may be received thatare linked to the data page for which the coalesce event has beendetected. In at least some embodiments, these additional redo logrecords may be applied when the other redo log records are applied tothe previously stored version of the data page.

As illustrated in FIG. 4, multiple storage nodes, 430, 440, 450, etc.may be implemented as part of a distributed storage service. The variousmethods and techniques described above with regard to FIG. 8 above maybe performed by these multiple storage nodes independently from oneanother. Each storage node may determine different or the same coalescethresholds, as well as perform detecting coalesce events and applyingone or more redo log records in response at the same or different timesfrom one another.

Turning now to FIG. 9A, which shows a series of illustrationsdemonstrating a method to perform fast crash recovery for a distributeddatabase system, according to some embodiments. Crash recovery in atypical database system is an arduous process. In these typical systems,upon recovery from a database system failure, a clean version of thedatabase is obtained, then all of the redo log records from transactionsthat have not been stored on disk must be replayed to restore thedatabase to its current state prior to the database system failure,creating a significant restore time before a database can be accessed.FIG. 9A, by contrast, provides illustrations of fast crash recovery fora distributed database system that may provide a faster and moreefficient technique to perform crash recovery.

In scene 992, a database client 906, such as database client 250described above with regard to FIG. 2, communicates over network 260,described above in FIG. 2, with a database head node 902, such asdatabase head node 430 described above with regard to FIG. 4, thatimplements a database. Storage nodes 908 may be one or more storagenodes that implement log-structured data storage for the databaseimplemented by database head node 902. Various access requests may bereceived, and subsequently serviced by database head node 902 uponretrieving the accessed data from storage nodes 908. Redo log records,such as those described above with regard to FIG. 8 may be generated andsent to storage nodes 908 in place of sending user data. Redo logrecords may be maintained at storage nodes 908. In at least someembodiments, a coalesce operation may be performed in response to thedetection of a coalesce event, such as described above with regard toFIG. 8.

Scene 994 illustrates a database head node 902 failure. A database headnode failure may be any type of system failure which causes the databasehead node to be unable to continue functioning, such as loss of power,no available memory, system glitch, etc. No communications betweendatabase client 906 and database head node 902 may be sent or received,as indicated in the illustration. Thus, no access to the database may beprovided. Likewise, no communications between storage nodes 908 anddatabase head node 902 may be sent or received, thus no requests fordata stored for the database may be processed.

In scene 996, a recovery operation may be illustrated. New database headnode 904, which may be a version of the head node application programrestarted on the same system hardware or another instance of the headnode started on different hardware may be brought online. Connectionswith storage nodes 908 may be established by database head node 904, asillustrated. Scene 998 depicts that upon establishment of connectionswith storage nodes 908, the same database as was implemented at databasehead node 902 may be made available for access at new database head node904. Access requests, such as read requests or write requests may besent from database client 906 via network 260 to new database head node904. New database head node 904 may not need to replay redo log recordsto obtain a current state of data prior to the database head nodefailure, as these redo log records were already sent to storage nodes908 which may provide a current version of data stored for the databaseto new database head node 908 for servicing an access request. Storagenodes 908 may apply redo log records to a previously stored version ofparticular data when a request for particular data is received.Alternatively, the current state of the particular data may be alreadystored at the storage nodes with any redo log records directed to theparticular having already been applied, such as when a coalesce event isdetected as discussed above with regard to FIG. 8.

FIG. 9B is a flow diagram illustrating a method to perform fast crashrecovery for a distributed database system, according to someembodiments. In various embodiments, a database head node failure mayoccur. This head node failure may prevent any communications,modifications, or other form of access to a database implemented andmanaged by the failed database head node. For example, a database systemclient, such as database client 250 described in FIG. 2, may not be ableto send read or write requests to a failed database head node. Thefailure of the database head node may be detected, such as by webservices platform 200 described above in FIG. 2, or some other system orcomponent. In response to the failure of the head node, a restarteddatabase head node or new database head node (e.g., a new database headnode virtual instance hosted one the same or different hardware as thepreviously failed head node) may be instructed to perform a recoveryoperation. In some embodiments, this recovery operation may include thevarious elements depicted in FIG. 9B, although it is not limited tothese elements.

Recovery from a database head node failure may occur, as indicated at910. Recovery may be performed and determined to be complete in avariety of ways. For example, a database head node application may havevarious states when preparing to run, such as performing various tests,enabling various devices, etc. As part of this process, a ready statemay be determined for the database head node which may indicate thecompletion of the recovery from node failure. Upon recovery from thedatabase node failure, as indicated at 910, a connection with one ormore storage nodes may be established storing data for a database may beestablished, as indicated at 920.

As described above with regard to FIG. 9A and various other figuresabove, a database may be implemented an managed by a database head node,such as database head node 320 or 440 described in FIGS. 3 and 4. Aspart of implementing the database access requests, such as read requestsor write requests described above may be processed at the database headnode. In at least some embodiments redo log records reflecting changesto a database are sent to one or more storage nodes, such as storagenodes 450 described above in FIG. 4, that reflect changes to data storedat the storage nodes. Storage nodes that store data to be changed, suchas particular data pages or other portions of data, may receive the redolog records which are linked to the portions of data, such as datapages, which are to be changed. These redo log records may then beapplied (e.g., a coalesce operation) to a previously stored version ofthe portion of data, such as the data page, in response to requests fora current version of the data page, or at some other time, such as inresponse to detecting a coalesce event. As the redo log records for thedatabase are maintained for the database implemented at the databasehead node, such as in the various ways discussed above, storage nodesmay, in some embodiments, send a current state of data that isguaranteed to be current up to the time of the database head nodefailure to the database head node.

The storage nodes with which to establish connections with may beidentified. For example, client-side storage service driver 425described above in FIG. 4, may maintain information that indicates whichstorage nodes store data for the database and which portions of thedatabase are stored on the storage nodes. A connection request, or someother communication message, may be sent using one of the variouscommunication methods discussed above with regard to FIG. 4. Likewise,acknowledgements and other information about the status of the storagenode and/or database head node may be exchanged.

Upon establishment of the connection with the one or more storage nodes,as indicated at 920, the database may be made available for access, asindicated at 930. In some embodiments, access may be provided for one ormore access requests (e.g., read requests, write requests). Anindication of the availability of the database may be generated and sentto a client. For example, a message may be sent to a database clientthat the database is available for access. Such a message may be sentvia web services platform 200, described in FIG. 2, or some othercommunication platform or device. As noted above, in typical databasesystems, replay of redo log records must be performed prior to makingthe database available. However, in at least some embodiments, thedatabase may be made available without replaying redo log records.Please note that the term “replay” when used with redo log recordsgenerally means to apply the one or more redo log records to apreviously stored version of a data.

In at least some embodiments, a storage node may be able to detect orotherwise made aware of a database head node failure. In response todetecting the database head node failure, a storage node may perform atruncate operation on redo log records received at the storage node. Atruncate operation may determine or identify redo log records that arepart of a system transaction that did not complete before the failure ofthe database head node. These identified redo log records may then beremoved or otherwise marked, moved, or identified so that they may notbe applied to to the data pages to which they have been linked. Forexample, if a storage page maintains 5 redo log records for a particulardata page, and the most recent 3 redo log records are part of a systemtransaction that did not complete before a database head node failure,then the storage node may ignore the most recent 3 redo log records forthe data page when generating a current state of the data page by onlyapplying the 2 oldest redo log records. In at least some embodiments, atruncate operation may be performed on a storage node with affected redolog records prior to allow a connection to be established with arecovered database head node. A database engine head node may, in someembodiments, be configured similarly to determine or identify redo logrecords that are part of a system transaction that did not completebefore the failure of the database head node and send a notification tostorage nodes that these identified redo log records may be removed orotherwise marked, moved, or identified so that they may not be appliedto the data pages to which they have been linked. For example, aclient-side storage service driver, such as client-side storage servicedriver 325 described above with regard to FIG. 3, may perform thepreviously described techniques. These techniques describing a truncateoperation may, in some embodiments, be performed as part of a backgroundprocess.

In at least some embodiments, a system transaction may be an operationor other form of task or tasks to perform or implement a usertransaction. A user transaction may include multiple system transactionsto perform various tasks or operations from a received access request.For example, an insert instruction to the database may be received. As auser transaction, this insert instruction, may include multiple systemtransactions to perform the insert, such as interacting the databasedata structures, e.g., b-trees, to perform the insert. In at least someembodiments, an incomplete user transaction, is a user transaction allof the system transactions included in the user transaction may have notbeen completed (or made durable). Similarly, a system transaction mayalso be incomplete. Redo log records that reflect the changes made todata stored for a database as a part of user and system transactionsmay, in some embodiments, be identified with a particular user and/orsystem transaction.

FIG. 9C is a flow diagram illustrating a method to process accessrequests in a recovered database, according to some embodiments. Asnoted above, in at least some embodiments, access requests may bereceived a database head node that has made the database available foraccess. An access requests may be a read request, write request, or anyother request to obtain or modify data stored for the database. As FIG.9C illustrates, an access request may be received for a database, asindicated at 940. In response, a request for one or more data pages fromone or more storage nodes may be made, as indicated 950 (both accessrequests from clients and data requests from a database head node arecovered in more detail with regard to FIG. 5 above). A current state ofthe requested one or more data pages may be received from the storagenodes, as indicated at 960. As discussed above, this current state maybe generated by replaying or applying the previously received redo logrecords to the previously stored version of the data page, or byreturning the previously stored version of the data page that is thecurrent state. In various embodiments, each data page or portion of datarequested may have its current state determined, generated, and/or sentback in response to receiving the request for data (e.g., in a lazyfashion).

In at least some embodiments, undo log records may be maintained at thedatabase head node. Undo log records, as discussed above, may recordchanges to be applied to data stored for a database to undo changes madeto the data, such as in the event of an incomplete user transaction. Auser transaction may include multiple changes to data stored for adatabase (such as multiple system transactions), generating one or moreredo log records and one or more undo log records. A user transactionmay be incomplete when not all of the changes of the user transactionwere committed (e.g., made durable). A transaction table, such astransaction log 340 described above with regard to FIG. 3, may beimplemented to indicate which user transactions and their associatedportions of data stored at the storage nodes were not committed prior tothe database head node failure, and thus are incomplete. As indicated at970, a determination may be made as to whether a received data page isaffected by an incomplete user transaction, such as indicated by thetransaction table. If yes, as the positive exit indicates, then one ormore of the undo log records may be applied to the data page to undochanges made by the incomplete transaction a generate a new currentstate of the data page, as indicated at 972. After undo log records havebeen applied, or the data page was not affected by an incomplete usertransaction, then, the current state of the data page may be providedfor servicing the access request, as indicated at 980.

In at least some embodiments, a background process may be performed thatdetermines or identifies portions of data affected by an incomplete usertransaction, based on the transaction table. Requests for the currentstate of portions of data, such as data pages, affected by theincomplete user transactions may sent and received. Undo log records maythen be applied to undo changes directed to these data pages by theincomplete user transaction. In various embodiments, a database cachemay be updated with these data pages after undo log records have beenapplied.

In at least some embodiments, a previously recorded snapshot may be usedto restore the state of the database to an earlier state. For example,prior to making the database available for access, a request may be sentto the storage nodes to restored the data for the database to a statecorresponding to a previously recorded snapshot. A snapshot may berecorded by identifying a time stamp or other marker or indicator forredo logs stored at storage nodes that allows previously received redolog records to be replayed up to the recorded snapshot point (e.g., thetimestamp or marker), wherein said restoration includes applying one ormore of the plurality of redo log to a previous version of the data.Further discussion of implementing snapshots on storage nodes isprovided above.

While the methods and techniques of FIGS. 9B-9C may be described asbeing performed by various components of a database system, such asdatabase engine head node 420, the method need not be performed by anyspecific component in some cases. For instance, in some cases, themethod of FIGS. 9B-9C may be performed by some other component orcomputer system, according to some embodiments. Or, in some cases,components of database system 400 may be combined or exist in adifferent manner than that shown in the example of FIG. 4. In variousembodiments, the methods of FIGS. 9B-9C may be performed by one or morecomputers of a distributed database system, one of which is shown as thecomputer system of FIG. 10. The methods of FIGS. 9B-9C are shown asexample implementations of methods for fast crash recovery of adistributed database system. In other implementations, the methods ofFIGS. 9B-9C may include additional or fewer blocks than are shown.

The methods described herein may in various embodiments be implementedby any combination of hardware and software. For example, in oneembodiment, the methods may be implemented by a computer system (e.g., acomputer system as in FIG. 10) that includes one or more processorsexecuting program instructions stored on a computer-readable storagemedium coupled to the processors. The program instructions may beconfigured to implement the functionality described herein (e.g., thefunctionality of various servers and other components that implement thedatabase services/systems and/or storage services/systems describedherein).

FIG. 10 is a block diagram illustrating a computer system configured toimplement at least a portion of the database systems described herein,according to various embodiments. For example, computer system 1000 maybe configured to implement a database engine head node of a databasetier, or one of a plurality of storage nodes of a separate distributeddatabase-optimized storage system that stores databases and associatedmetadata on behalf of clients of the database tier, in differentembodiments. Computer system 1000 may be any of various types ofdevices, including, but not limited to, a personal computer system,desktop computer, laptop or notebook computer, mainframe computersystem, handheld computer, workstation, network computer, a consumerdevice, application server, storage device, telephone, mobile telephone,or in general any type of computing device.

Computer system 1000 includes one or more processors 1010 (any of whichmay include multiple cores, which may be single or multi-threaded)coupled to a system memory 1020 via an input/output (I/O) interface1030. Computer system 1000 further includes a network interface 1040coupled to I/O interface 1030. In various embodiments, computer system1000 may be a uniprocessor system including one processor 1010, or amultiprocessor system including several processors 1010 (e.g., two,four, eight, or another suitable number). Processors 1010 may be anysuitable processors capable of executing instructions. For example, invarious embodiments, processors 1010 may be general-purpose or embeddedprocessors implementing any of a variety of instruction setarchitectures (ISAs), such as the x86, PowerPC, SPARC, or MIPS ISAs, orany other suitable ISA. In multiprocessor systems, each of processors1010 may commonly, but not necessarily, implement the same ISA. Thecomputer system 1000 also includes one or more network communicationdevices (e.g., network interface 1040) for communicating with othersystems and/or components over a communications network (e.g. Internet,LAN, etc.). For example, a client application executing on system 1000may use network interface 1040 to communicate with a server applicationexecuting on a single server or on a cluster of servers that implementone or more of the components of the database systems described herein.In another example, an instance of a server application executing oncomputer system 1000 may use network interface 1040 to communicate withother instances of the server application (or another serverapplication) that may be implemented on other computer systems (e.g.,computer systems 1090).

In the illustrated embodiment, computer system 1000 also includes one ormore persistent storage devices 1060 and/or one or more I/O devices1080. In various embodiments, persistent storage devices 1060 maycorrespond to disk drives, tape drives, solid state memory, other massstorage devices, or any other persistent storage device. Computer system1000 (or a distributed application or operating system operatingthereon) may store instructions and/or data in persistent storagedevices 1060, as desired, and may retrieve the stored instruction and/ordata as needed. For example, in some embodiments, computer system 1000may host a storage system server node, and persistent storage 1060 mayinclude the SSDs attached to that server node.

Computer system 1000 includes one or more system memories 1020 that areconfigured to store instructions and data accessible by processor(s)1010. In various embodiments, system memories 1020 may be implementedusing any suitable memory technology, (e.g., one or more of cache,static random access memory (SRAM), DRAM, RDRAM, EDO RAM, DDR 10 RAM,synchronous dynamic RAM (SDRAM), Rambus RAM, EEPROM,non-volatile/Flash-type memory, or any other type of memory). Systemmemory 1020 may contain program instructions 1025 that are executable byprocessor(s) 1010 to implement the methods and techniques describedherein. In various embodiments, program instructions 1025 may be encodedin platform native binary, any interpreted language such as Java™byte-code, or in any other language such as C/C++, Java™, etc., or inany combination thereof. For example, in the illustrated embodiment,program instructions 1025 include program instructions executable toimplement the functionality of a database engine head node of a databasetier, or one of a plurality of storage nodes of a separate distributeddatabase-optimized storage system that stores databases and associatedmetadata on behalf of clients of the database tier, in differentembodiments. In some embodiments, program instructions 1025 mayimplement multiple separate clients, server nodes, and/or othercomponents.

In some embodiments, program instructions 1025 may include instructionsexecutable to implement an operating system (not shown), which may beany of various operating systems, such as UNIX, LINUX, Solaris™, MacOS™,Windows™, etc. Any or all of program instructions 1025 may be providedas a computer program product, or software, that may include anon-transitory computer-readable storage medium having stored thereoninstructions, which may be used to program a computer system (or otherelectronic devices) to perform a process according to variousembodiments. A non-transitory computer-readable storage medium mayinclude any mechanism for storing information in a form (e.g., software,processing application) readable by a machine (e.g., a computer).Generally speaking, a non-transitory computer-accessible medium mayinclude computer-readable storage media or memory media such as magneticor optical media, e.g., disk or DVD/CD-ROM coupled to computer system1000 via I/O interface 1030. A non-transitory computer-readable storagemedium may also include any volatile or non-volatile media such as RAM(e.g. SDRAM, DDR SDRAM, RDRAM, SRAM, etc.), ROM, etc., that may beincluded in some embodiments of computer system 1000 as system memory1020 or another type of memory. In other embodiments, programinstructions may be communicated using optical, acoustical or other formof propagated signal (e.g., carrier waves, infrared signals, digitalsignals, etc.) conveyed via a communication medium such as a networkand/or a wireless link, such as may be implemented via network interface1040.

In some embodiments, system memory 1020 may include data store 1045,which may be configured as described herein. For example, theinformation described herein as being stored by the database tier (e.g.,on a database engine head node), such as a transaction log, an undo log,cached page data, or other information used in performing the functionsof the database tiers described herein may be stored in data store 1045or in another portion of system memory 1020 on one or more nodes, inpersistent storage 1060, and/or on one or more remote storage devices1070, at different times and in various embodiments. Similarly, theinformation described herein as being stored by the storage tier (e.g.,redo log records, coalesced data pages, and/or other information used inperforming the functions of the distributed storage systems describedherein) may be stored in data store 1045 or in another portion of systemmemory 1020 on one or more nodes, in persistent storage 1060, and/or onone or more remote storage devices 1070, at different times and invarious embodiments. In general, system memory 1020 (e.g., data store1045 within system memory 1020), persistent storage 1060, and/or remotestorage 1070 may store data blocks, replicas of data blocks, metadataassociated with data blocks and/or their state, database configurationinformation, and/or any other information usable in implementing themethods and techniques described herein.

In one embodiment, I/O interface 1030 may be configured to coordinateI/O traffic between processor 1010, system memory 1020 and anyperipheral devices in the system, including through network interface1040 or other peripheral interfaces. In some embodiments, I/O interface1030 may perform any necessary protocol, timing or other datatransformations to convert data signals from one component (e.g., systemmemory 1020) into a format suitable for use by another component (e.g.,processor 1010). In some embodiments, I/O interface 1030 may includesupport for devices attached through various types of peripheral buses,such as a variant of the Peripheral Component Interconnect (PCI) busstandard or the Universal Serial Bus (USB) standard, for example. Insome embodiments, the function of I/O interface 1030 may be split intotwo or more separate components, such as a north bridge and a southbridge, for example. Also, in some embodiments, some or all of thefunctionality of I/O interface 1030, such as an interface to systemmemory 1020, may be incorporated directly into processor 1010.

Network interface 1040 may be configured to allow data to be exchangedbetween computer system 1000 and other devices attached to a network,such as other computer systems 1090 (which may implement one or morestorage system server nodes, database engine head nodes, and/or clientsof the database systems described herein), for example. In addition,network interface 1040 may be configured to allow communication betweencomputer system 1000 and various I/O devices 1050 and/or remote storage1070. Input/output devices 1050 may, in some embodiments, include one ormore display terminals, keyboards, keypads, touchpads, scanning devices,voice or optical recognition devices, or any other devices suitable forentering or retrieving data by one or more computer systems 1000.Multiple input/output devices 1050 may be present in computer system1000 or may be distributed on various nodes of a distributed system thatincludes computer system 1000. In some embodiments, similar input/outputdevices may be separate from computer system 1000 and may interact withone or more nodes of a distributed system that includes computer system1000 through a wired or wireless connection, such as over networkinterface 1040. Network interface 1040 may commonly support one or morewireless networking protocols (e.g., Wi-Fi/IEEE 802.11, or anotherwireless networking standard). However, in various embodiments, networkinterface 1040 may support communication via any suitable wired orwireless general data networks, such as other types of Ethernetnetworks, for example. Additionally, network interface 1040 may supportcommunication via telecommunications/telephony networks such as analogvoice networks or digital fiber communications networks, via storagearea networks such as Fibre Channel SANs, or via any other suitable typeof network and/or protocol. In various embodiments, computer system 1000may include more, fewer, or different components than those illustratedin FIG. 10 (e.g., displays, video cards, audio cards, peripheraldevices, other network interfaces such as an ATM interface, an Ethernetinterface, a Frame Relay interface, etc.)

It is noted that any of the distributed system embodiments describedherein, or any of their components, may be implemented as one or moreweb services. For example, a database engine head node within thedatabase tier of a database system may present database services and/orother types of data storage services that employ the distributed storagesystems described herein to clients as web services. In someembodiments, a web service may be implemented by a software and/orhardware system designed to support interoperable machine-to-machineinteraction over a network. A web service may have an interfacedescribed in a machine-processable format, such as the Web ServicesDescription Language (WSDL). Other systems may interact with the webservice in a manner prescribed by the description of the web service'sinterface. For example, the web service may define various operationsthat other systems may invoke, and may define a particular applicationprogramming interface (API) to which other systems may be expected toconform when requesting the various operations.

In various embodiments, a web service may be requested or invokedthrough the use of a message that includes parameters and/or dataassociated with the web services request. Such a message may beformatted according to a particular markup language such as ExtensibleMarkup Language (XML), and/or may be encapsulated using a protocol suchas Simple Object Access Protocol (SOAP). To perform a web servicesrequest, a web services client may assemble a message including therequest and convey the message to an addressable endpoint (e.g., aUniform Resource Locator (URL)) corresponding to the web service, usingan Internet-based application layer transfer protocol such as HypertextTransfer Protocol (HTTP).

In some embodiments, web services may be implemented usingRepresentational State Transfer (“RESTful”) techniques rather thanmessage-based techniques. For example, a web service implementedaccording to a RESTful technique may be invoked through parametersincluded within an HTTP method such as PUT, GET, or DELETE, rather thanencapsulated within a SOAP message.

The various methods as illustrated in the figures and described hereinrepresent example embodiments of methods. The methods may be implementedmanually, in software, in hardware, or in a combination thereof. Theorder of any method may be changed, and various elements may be added,reordered, combined, omitted, modified, etc.

Although the embodiments above have been described in considerabledetail, numerous variations and modifications may be made as wouldbecome apparent to those skilled in the art once the above disclosure isfully appreciated. It is intended that the following claims beinterpreted to embrace all such modifications and changes and,accordingly, the above description to be regarded in an illustrativerather than a restrictive sense.

1. A system, comprising: at least one database engine head node of adatabase service, configured to: generate one or more redo log recordslinked to a particular data page of a plurality of data pages stored ona storage node of a plurality of storage nodes implementing adistributed storage service, wherein the storage nodes stores data for adatabase in a plurality of data pages including the particular datapage, wherein each of the one or more redo log records is generated inresponse to one or more access requests for data stored within theparticular data page; send the one or more redo log records to thestorage node; the storage node of the distributed storage service,configured to: store the received one or more redo log records linked tothe particular data page; determine that the one or more redo logrecords linked to the particular data page exceed a coalesce threshold;and perform a coalesce operation, wherein said coalesce operationcomprises applying the one or more redo log records linked to theparticular data page to a previously stored version of the particulardata page to generate the particular data page in its current state. 2.The system of claim 1, wherein the storage node is further configured tomaintain for each of the plurality of data pages a redo log recordcount; and wherein, to determine that the one or more redo log recordslinked to the particular data page exceed the coalesce threshold, the atleast one compute node is further configured to determine that the redolog record count maintained for the particular data page exceeds thecoalesce threshold.
 3. The system of claim 2, wherein the storage nodeis further configured to, in response to performing the coalesceoperation, update the redo log record count to remove from the redo logrecord count the one or more redo log records linked to the particulardata page.
 4. The system of claim 1, wherein the database engine headnode has previously generated and sent one or more other redo log pageslinked to another data page of the plurality of data pages stored on thestorage node; wherein the database engine head node is furtherconfigured to: upon recovery from a database engine head node failure,send a request for the current state of the particular data page and acurrent state of the other data page to the storage node; wherein thestorage node is further configured to: receive the request for thecurrent state of the particular data page and the current state of theother data page from the database engine head node; and in response toreceiving the request for the particular data page, send a previouslygenerated current state of the particular data page to the databaseengine head node; in response to receiving the request for the otherdata page: perform a coalesce operation to apply the one or more otherredo log records linked to the other data page to a previously storedversion of the other data page to generate the other data page in itscurrent state; and send the current state of the other data page to thedatabase engine head node.
 5. A method, comprising: performing, by oneor more computing devices: maintaining one or more redo log recordslinked to a particular data page stored for a database; detecting acoalesce event for the particular data page based, at least in part, onthe one or more redo log records linked to the particular data page; andin response to detecting the coalesce event for the particular datapage, applying the one or more redo log records linked to the particulardata page to a previously stored version of the particular data page togenerate the particular data page in its current state.
 6. The method ofclaim 5, wherein said detecting the coalesce event for the particulardata page occurs aperiodically.
 7. The method of claim 5, wherein saiddetecting the coalesce event for the particular data page furthercomprises determining that the one or more redo log records linked tothe particular data page exceed a coalesce threshold.
 8. The method ofclaim 7, wherein said detecting the coalesce event for the particulardata page further comprises determining the coalesce threshold accordingto a user-defined coalesce threshold.
 9. The method of claim 7, furthercomprising: maintaining one or more additional redo log records linkedto a different data page stored for the database; and determining thatthe one or more additional redo log records linked to the different datapage exceed another coalesce threshold, wherein the other coalescethreshold is different from the coalesce threshold.
 10. The method ofclaim 5, wherein the one or more computing devices together implement astorage node of a plurality of storage nodes implementing a distributedstorage service, wherein the one or more redo log records are includedin a plurality of redo log records each linked to one of a plurality ofdata pages including the particular data page stored for the databaseacross the plurality of storage nodes, wherein the plurality of redo logrecords are received from a database system.
 11. The method of claim 10,wherein one or more other storage nodes of the plurality of storagenodes perform said maintaining, said detecting, and said applying fordifferent ones of the plurality of data pages stored on the one or moreother storage nodes.
 12. The method of claim 7, wherein said detectingand said applying are performed at different times for the differentones of data pages stored on the one or more other storage nodes. 13.The method of claim 5, wherein the one or more computing devicestogether implement a storage node of a plurality of storage nodesimplementing a distributed storage service, further comprising: inresponse to detecting the coalesce event for the particular data page:prior to applying the one or more redo log records linked to theparticular data page to a previously stored version of the particulardata page to generate the particular data page in its current state,delaying the start of said applying the one or more redo log recordsbased, at least in part, on a workload of other processes performed bythe storage node.
 14. A non-transitory, computer-readable storagemedium, storing program instructions that when executed by one or morecomputing devices implement: maintaining one or more redo log recordslinked to a particular data page stored for a database; determining thatthe one or more redo log records linked to the particular data pageexceed a coalesce threshold; and applying the one or more redo logrecords linked to the particular data page to a previously storedversion of the particular data page to generate the particular data pagein its current state.
 15. The non-transitory, computer readable storagemedium of claim 14, wherein the one or more computing devices togetherimplement a storage node of a distributed storage service, and whereinthe program instructions when executed by the one or more computingdevices further implement determining the coalesce threshold based, atleast in part, on performance of the storage node.
 16. Thenon-transitory, computer-readable storage medium of claim 14, whereinthe program instructions when executed by the one or more computingdevices further implement determining the coalesce threshold based, atleast in part, on a frequency of received redo log records linked to theparticular data page.
 17. The non-transitory, computer-readable storagemedium of claim 14, wherein the program instructions when executed bythe one or more computing devices further implement determining thecoalesce threshold based, at least in part, on storage spaceavailability.
 18. The non-transitory, computer-readable storage mediumof claim 14, wherein the program instructions when executed by the oneor more computing devices further implement determining the coalescethreshold based, at least in part, a time when said applying the one ormore redo log records may be performed.
 19. The non-transitory,computer-readable storage medium of claim 14, wherein the programinstructions when executed by the one or more computing devices furtherimplement determining the coalesce threshold based, at least in part, onone or more sizes of the one or more redo log records linked to theparticular data page.
 20. The non-transitory, computer-readable storagemedium of claim 14, wherein the program instructions when executed bythe one or more computing devices further implement determining thecoalesce threshold based, at least in part, on one or more storagelocations for the one or more redo log records linked to the particulardata page. 21.-23. (canceled)